@wordpress/components
Version:
UI components for WordPress.
33 lines • 1.14 kB
TypeScript
/**
* Internal dependencies
*/
import type { AlignmentMatrixControlValue } from './types';
export declare const GRID: AlignmentMatrixControlValue[][];
export declare const ALIGNMENT_LABEL: Record<AlignmentMatrixControlValue, string>;
export declare const ALIGNMENTS: AlignmentMatrixControlValue[];
/**
* Creates an item ID based on a prefix ID and an alignment value.
*
* @param prefixId An ID to prefix.
* @param value An alignment value.
*
* @return The item id.
*/
export declare function getItemId(prefixId: string, value?: AlignmentMatrixControlValue): string | undefined;
/**
* Extracts an item value from its ID
*
* @param prefixId An ID prefix to remove
* @param id An item ID
* @return The item value
*/
export declare function getItemValue(prefixId: string, id?: string | null): AlignmentMatrixControlValue | undefined;
/**
* Retrieves the alignment index from a value.
*
* @param alignment Value to check.
*
* @return The index of a matching alignment.
*/
export declare function getAlignmentIndex(alignment?: AlignmentMatrixControlValue): number | undefined;
//# sourceMappingURL=utils.d.ts.map