import type { Formatting } from "@player-ui/types"; export type FormatOptions = Omit; /** * The return types for the schema don't include options. * These are already sent to the generic formatter function for that type */ export type FormatFunction = (val: From, options?: Options) => To | undefined; export type FormatHandler = (val: From) => To; export interface FormatDefinition { /** * A function to format data (from the data-model to the user). * Defaults to the identify function */ format: FormatHandler; /** * A function to invert the formatting (from the user to the data-model) * Defaults to the identify function. */ deformat: FormatHandler; } export interface FormatType { /** * The name of the formatter. * This corresponds to the 'type' format property when creating a DataType */ name: string; /** * An optional function to format data for display to the user. * This goes from dataModel -> UI display */ format?: FormatFunction; /** * An optional function for undo the action of a format function for storage. * This goes from UI -> dataModel */ deformat?: FormatFunction; } //# sourceMappingURL=types.d.ts.map