@wordpress/blocks
Version:
Block API for WordPress.
97 lines • 4.22 kB
TypeScript
import type { BlockType, BlockCategory, BlockCollection, BlockStyle, BlockVariation, BlockBindingsSource } from '../types';
import type { Action } from './types';
/**
* Default set of categories.
*/
export declare const DEFAULT_CATEGORIES: BlockCategory[];
/**
* Reducer managing the unprocessed block types in a form passed when registering the by block.
* It's for internal use only. It allows recomputing the processed block types on-demand after block type filters
* get added or removed.
*
* @param state Current state.
* @param action Dispatched action.
*
* @return Updated state.
*/
export declare function unprocessedBlockTypes(state: Record<string, Partial<BlockType>> | undefined, action: Action): Record<string, Partial<BlockType>>;
/**
* Reducer managing the processed block types with all filters applied.
* The state is derived from the `unprocessedBlockTypes` reducer.
*
* @param state Current state.
* @param action Dispatched action.
*
* @return Updated state.
*/
export declare function blockTypes(state: Record<string, BlockType> | undefined, action: Action): Record<string, BlockType>;
/**
* Reducer managing the block styles.
*
* @param state Current state.
* @param action Dispatched action.
*
* @return Updated state.
*/
export declare function blockStyles(state: Record<string, BlockStyle[]> | undefined, action: Action): Record<string, BlockStyle[]>;
/**
* Reducer managing the block variations.
*
* @param state Current state.
* @param action Dispatched action.
*
* @return Updated state.
*/
export declare function blockVariations(state: Record<string, BlockVariation[]> | undefined, action: Action): Record<string, BlockVariation[]>;
/**
* Higher-order Reducer creating a reducer keeping track of given block name.
*
* @param setActionType Action type.
*
* @return Reducer.
*/
export declare function createBlockNameSetterReducer(setActionType: string): (state: string | null | undefined, action: Action) => string | null;
export declare const defaultBlockName: (state: string | null | undefined, action: Action) => string | null;
export declare const freeformFallbackBlockName: (state: string | null | undefined, action: Action) => string | null;
export declare const unregisteredFallbackBlockName: (state: string | null | undefined, action: Action) => string | null;
export declare const groupingBlockName: (state: string | null | undefined, action: Action) => string | null;
/**
* Reducer managing the categories
*
* @param state Current state.
* @param action Dispatched action.
*
* @return Updated state.
*/
export declare function categories(state: BlockCategory[] | undefined, action: Action): BlockCategory[];
export declare function collections(state: Record<string, BlockCollection> | undefined, action: Action): Record<string, BlockCollection>;
export declare function blockBindingsSources(state: Record<string, Omit<BlockBindingsSource, "name">> | undefined, action: Action): Record<string, Omit<BlockBindingsSource, 'name'>>;
declare const _default: import("redux").Reducer<{
bootstrappedBlockTypes: Record<string, Partial<BlockType<Record<string, unknown>>>>;
unprocessedBlockTypes: Record<string, Partial<BlockType<Record<string, unknown>>>>;
blockTypes: Record<string, BlockType<Record<string, unknown>>>;
blockStyles: Record<string, BlockStyle[]>;
blockVariations: Record<string, BlockVariation<Record<string, unknown>>[]>;
defaultBlockName: string | null;
freeformFallbackBlockName: string | null;
unregisteredFallbackBlockName: string | null;
groupingBlockName: string | null;
categories: BlockCategory[];
collections: Record<string, BlockCollection>;
blockBindingsSources: Record<string, Omit<BlockBindingsSource, "name">>;
}, Action, Partial<{
bootstrappedBlockTypes: never;
unprocessedBlockTypes: never;
blockTypes: never;
blockStyles: never;
blockVariations: never;
defaultBlockName: never;
freeformFallbackBlockName: never;
unregisteredFallbackBlockName: never;
groupingBlockName: never;
categories: never;
collections: never;
blockBindingsSources: never;
}>>;
export default _default;
//# sourceMappingURL=reducer.d.ts.map