@types/wordpress__block-editor 6.0.1 → 6.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wordpress__block-editor/README.md +2 -2
- wordpress__block-editor/components/index.d.ts +6 -1
- wordpress__block-editor/components/inner-blocks.d.ts +1 -1
- wordpress__block-editor/components/media-placeholder.d.ts +1 -1
- wordpress__block-editor/components/use-block-props.d.ts +29 -0
- wordpress__block-editor/index.d.ts +3 -0
- wordpress__block-editor/package.json +8 -3
|
@@ -8,9 +8,9 @@ This package contains type definitions for @wordpress/block-editor (https://gith
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wordpress__block-editor.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 24 Jan 2022 16:31:34 GMT
|
|
12
12
|
* Dependencies: [@types/wordpress__blocks](https://npmjs.com/package/@types/wordpress__blocks), [@types/wordpress__data](https://npmjs.com/package/@types/wordpress__data), [@types/react](https://npmjs.com/package/@types/react), [@types/wordpress__components](https://npmjs.com/package/@types/wordpress__components), [@types/react-autosize-textarea](https://npmjs.com/package/@types/react-autosize-textarea), [@types/wordpress__keycodes](https://npmjs.com/package/@types/wordpress__keycodes)
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
|
15
15
|
# Credits
|
|
16
|
-
These definitions were written by [Derek Sifford](https://github.com/dsifford),
|
|
16
|
+
These definitions were written by [Derek Sifford](https://github.com/dsifford), [Jon Surrell](https://github.com/sirreal), and [Dennis Snell](https://github.com/dmsnell).
|
|
@@ -12,7 +12,7 @@ export { default as BlockFormatControls } from './block-format-controls';
|
|
|
12
12
|
export { default as BlockIcon } from './block-icon';
|
|
13
13
|
export { default as BlockNavigationDropdown } from './block-navigation/dropdown';
|
|
14
14
|
export { default as BlockVerticalAlignmentToolbar } from './block-vertical-alignment-toolbar';
|
|
15
|
-
export { default as
|
|
15
|
+
export { default as ButtonBlockAppender } from './button-block-appender';
|
|
16
16
|
export { default as ColorPalette } from './color-palette';
|
|
17
17
|
export { default as ContrastChecker } from './contrast-checker';
|
|
18
18
|
export { default as InnerBlocks } from './inner-blocks';
|
|
@@ -56,3 +56,8 @@ export { default as WritingFlow } from './writing-flow';
|
|
|
56
56
|
* State Related Components
|
|
57
57
|
*/
|
|
58
58
|
export { default as BlockEditorProvider } from './provider';
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* Hooks
|
|
62
|
+
*/
|
|
63
|
+
export { useBlockProps } from './use-block-props';
|
|
@@ -45,7 +45,7 @@ declare const InnerBlocks: {
|
|
|
45
45
|
* display a `+` (plus) icon button that, when clicked, displays the block picker menu. No
|
|
46
46
|
* default Block is inserted.
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
ButtonBlockAppender: ComponentType<{ children?: never | undefined }>;
|
|
49
49
|
/**
|
|
50
50
|
* display the default block appender as set by `wp.blocks.setDefaultBlockName`. Typically this
|
|
51
51
|
* is the `paragraph` block.
|
|
@@ -78,7 +78,7 @@ declare namespace MediaPlaceholder {
|
|
|
78
78
|
onError?(message: string): void;
|
|
79
79
|
onSelectURL?(src: string): void;
|
|
80
80
|
multiple?: T | undefined;
|
|
81
|
-
value?: T extends true ? number[] : number | undefined;
|
|
81
|
+
value?: T extends true ? number[] : number | undefined | undefined | undefined | undefined;
|
|
82
82
|
onSelect(
|
|
83
83
|
value: T extends true ? Array<{ id: number } & { [k: string]: any }> : { id: number } & { [k: string]: any }
|
|
84
84
|
): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Ref, RefCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface Reserved {
|
|
4
|
+
id: string;
|
|
5
|
+
role: 'document';
|
|
6
|
+
tabIndex: 0;
|
|
7
|
+
'aria-label': string;
|
|
8
|
+
'data-block': string;
|
|
9
|
+
'data-type': string;
|
|
10
|
+
'data-title': string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Merged {
|
|
14
|
+
className: string;
|
|
15
|
+
style: Record<string, unknown>;
|
|
16
|
+
ref: RefCallback<unknown>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface UseBlockProps {
|
|
20
|
+
<Props extends Record<string, unknown>>(
|
|
21
|
+
props?: Props & {
|
|
22
|
+
[K in keyof Props]: K extends keyof Reserved ? never : Props[K];
|
|
23
|
+
} & { ref?: Ref<unknown> },
|
|
24
|
+
): Omit<Props, 'ref'> & Merged & Reserved;
|
|
25
|
+
|
|
26
|
+
save: (props?: Record<string, unknown>) => Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const useBlockProps: UseBlockProps;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Project: https://github.com/WordPress/gutenberg/tree/master/packages/block-editor/README.md
|
|
3
3
|
// Definitions by: Derek Sifford <https://github.com/dsifford>
|
|
4
4
|
// Jon Surrell <https://github.com/sirreal>
|
|
5
|
+
// Dennis Snell <https://github.com/dmsnell>
|
|
5
6
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
6
7
|
// TypeScript Version: 3.6
|
|
7
8
|
import { BlockIconNormalized } from '@wordpress/blocks';
|
|
@@ -17,6 +18,8 @@ declare module '@wordpress/data' {
|
|
|
17
18
|
function select(key: 'core/block-editor'): typeof import('./store/selectors');
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
export const store: any;
|
|
22
|
+
|
|
20
23
|
export type EditorBlockMode = 'html' | 'visual';
|
|
21
24
|
export type EditorMode = 'text' | 'visual';
|
|
22
25
|
export type EditorTemplateLock = 'all' | 'insert' | false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/wordpress__block-editor",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.5",
|
|
4
4
|
"description": "TypeScript definitions for @wordpress/block-editor",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wordpress__block-editor",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"name": "Jon Surrell",
|
|
15
15
|
"url": "https://github.com/sirreal",
|
|
16
16
|
"githubUsername": "sirreal"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "Dennis Snell",
|
|
20
|
+
"url": "https://github.com/dmsnell",
|
|
21
|
+
"githubUsername": "dmsnell"
|
|
17
22
|
}
|
|
18
23
|
],
|
|
19
24
|
"main": "",
|
|
@@ -33,6 +38,6 @@
|
|
|
33
38
|
"@wordpress/element": "^3.0.0",
|
|
34
39
|
"react-autosize-textarea": "^7.1.0"
|
|
35
40
|
},
|
|
36
|
-
"typesPublisherContentHash": "
|
|
37
|
-
"typeScriptVersion": "3.
|
|
41
|
+
"typesPublisherContentHash": "352983e33a2e5fc2084c2fe72c8bac41412034ba2c8e7fe82987303fdb996a0d",
|
|
42
|
+
"typeScriptVersion": "3.8"
|
|
38
43
|
}
|