PluginProbe
Parse.ly / 3.16.1
Parse.ly v3.16.1
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
wp-parsely / src / @types / gutenberg / types.ts

types.ts in Parse.ly 3.16.1, at src/@types/gutenberg/types.ts

59 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // eslint-disable-next-line import/named
2 import { BlockInstance } from '@wordpress/blocks';
3 import { dispatch } from '@wordpress/data';
4
5 /**
6 * Defines typings for some non-exported Gutenberg functions to avoid
7 * intellisense errors in function calls.
8 *
9 * This can be removed once Gutenberg provides typings for these functions.
10 *
11 * @since 3.12.0
12 */
13 export interface GutenbergFunction {
14 editPost( edits: Record<string, unknown> ): void;
15 getBlock( clientId: string ): BlockInstance | null;
16 getBlockParents( clientId: string ): string[];
17 getBlocks(): BlockInstance[];
18 getCurrentPostAttribute( attribute: string ): string;
19 getCurrentPostId(): number | undefined;
20 getEditedPostAttribute( attribute: string ): string;
21 getEditedPostContent(): string;
22 getPermalink(): string | null;
23 getPermalink(): string | null;
24 getSelectedBlock(): BlockInstance | null;
25 hasMetaBoxes(): boolean;
26 isAutosavingPost(): boolean;
27 isSavingPost(): boolean;
28 lockPostSaving( lockName: string ): void;
29 lockPostAutosaving( lockName: string ): void;
30 unlockPostAutosaving( lockName: string ): void;
31 removeEditorPanel( panelName: string ): void;
32 selectBlock( clientId: string, initialPosition?: number ): void;
33 unlockPostSaving( lockName: string ): void;
34 updateBlockAttributes( clientId: string, attributes: Record<string, unknown> ): void;
35 }
36
37 /**
38 * Alias for dispatch( 'core/block-editor' ) calls that prevents intellisense
39 * errors.
40 *
41 * @since 3.16.0
42 */
43 export const dispatchCoreBlockEditor = dispatch( 'core/block-editor' ) as GutenbergFunction;
44
45 /**
46 * Alias for dispatch( 'core/editor' ) calls that prevents intellisense errors.
47 *
48 * @since 3.16.0
49 */
50 export const dispatchCoreEditor = dispatch( 'core/editor' ) as GutenbergFunction;
51
52 /**
53 * Alias for dispatch( 'core/edit-post' ) calls that prevents intellisense
54 * errors.
55 *
56 * @since 3.16.0
57 */
58 export const dispatchCoreEditPost = dispatch( 'core/edit-post' ) as GutenbergFunction;
59