09272dffeb
@robonen/editor: migrate to eslint flat config + composite tsconfig; fix convergence test type annotations.
12 lines
405 B
TypeScript
12 lines
405 B
TypeScript
import type { AttrValue } from '../model';
|
|
|
|
/** Specification for a single attribute: default, requiredness, validation. */
|
|
export interface AttrSpec<V extends AttrValue = AttrValue> {
|
|
readonly default?: V;
|
|
readonly required?: boolean;
|
|
readonly validate?: (value: unknown) => boolean;
|
|
}
|
|
|
|
/** Map of attribute name → {@link AttrSpec}. */
|
|
export type AttrsSpec = Readonly<Record<string, AttrSpec>>;
|