Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/wordpress__blocks/api/registration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function getBlockSupport<T>(
* Returns a registered block type.
*/
// tslint:disable:no-unnecessary-generics
export function getBlockType<T = any>(name: string | undefined): Block<T> | undefined;
export function getBlockType<T extends Record<string, any> = any>(name: string | undefined): Block<T> | undefined;

/**
* Returns all registered blocks.
Expand Down
4 changes: 2 additions & 2 deletions types/wordpress__blocks/api/serializer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getBlockMenuDefaultClassName(blockName: string): string;
* @param attributes - Block attributes.
* @param innerBlocks - Nested blocks.
*/
export function getSaveContent<T>(
export function getSaveContent<T extends Record<string, any>>(
blockTypeOrName: Block<T> | string,
attributes: T,
innerBlocks?: BlockInstance[]
Expand All @@ -39,7 +39,7 @@ export function getSaveContent<T>(
* @param attributes - Block attributes.
* @param innerBlocks - Nested blocks.
*/
export function getSaveElement<T>(
export function getSaveElement<T extends Record<string, any>>(
blockTypeOrName: Block<T> | string,
attributes: T,
innerBlocks?: BlockInstance[]
Expand Down
2 changes: 1 addition & 1 deletion types/wordpress__blocks/api/validation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Block } from '../';
* @param attributes - Parsed block attributes.
* @param originalBlockContent - Original block content.
*/
export function isValidBlockContent<T>(
export function isValidBlockContent<T extends Record<string, any>>(
blockTypeOrName: Block<T> | string,
attributes: T,
originalBlockContent: string
Expand Down
2 changes: 1 addition & 1 deletion types/wordpress__data/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const plugins: {
}>;
};

export function use<T>(plugin: Plugin<T>, options: T): DataRegistry;
export function use<T extends Record<string, any>>(plugin: Plugin<T>, options: T): DataRegistry;

//
// Factory functions
Expand Down