Skip to content

Commit e9231c9

Browse files
committed
Add typings in core-data for @wordpress__blocks
1 parent 4d1610a commit e9231c9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

packages/core-data/src/utils/crdt-blocks.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import fastDeepEqual from 'fast-deep-equal/es6';
77
/**
88
* WordPress dependencies
99
*/
10+
import { getBlockTypes } from '@wordpress/blocks';
1011
import { RichTextData } from '@wordpress/rich-text';
1112
import { Y } from '@wordpress/sync';
1213

13-
// @ts-expect-error No exported types.
14-
import { getBlockTypes } from '@wordpress/blocks';
15-
1614
/**
1715
* Internal dependencies
1816
*/

packages/core-data/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"checkJs": false,
66
"noImplicitAny": false
77
},
8+
"include": [ "src", "typings" ],
89
"references": [
910
{ "path": "../api-fetch" },
1011
{ "path": "../compose" },
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare module '@wordpress/blocks' {
2+
interface BlockType {
3+
name: string;
4+
attributes?: Record< string, { type?: string } >;
5+
}
6+
7+
function getBlockTypes(): BlockType[];
8+
}

0 commit comments

Comments
 (0)