@types/wordpress__block-editor 6.0.4 → 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.
@@ -8,7 +8,7 @@ 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: Sun, 29 Aug 2021 16:31:27 GMT
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
 
@@ -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';
@@ -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;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/wordpress__block-editor",
3
- "version": "6.0.4",
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",
@@ -38,6 +38,6 @@
38
38
  "@wordpress/element": "^3.0.0",
39
39
  "react-autosize-textarea": "^7.1.0"
40
40
  },
41
- "typesPublisherContentHash": "1f7f262aa7ae156329e3cfe9cd92e841c12dde25f79835969c9aec8eb1efa5af",
42
- "typeScriptVersion": "3.7"
41
+ "typesPublisherContentHash": "352983e33a2e5fc2084c2fe72c8bac41412034ba2c8e7fe82987303fdb996a0d",
42
+ "typeScriptVersion": "3.8"
43
43
  }