ant-design-x-vue-next
Version:
Ant Design X for Vue — community continuation aligned with @ant-design/x
38 lines (37 loc) • 1.33 kB
TypeScript
/**
* Card v0.8 helpers (aligned with @ant-design/x-card Card.v0.8.ts).
*
* Commands: surfaceUpdate / dataModelUpdate / beginRendering / deleteSurface
* Action: { name, context: [{ key, value: { path } | { literalString } | literal }] }
*/
import { getValueByPath, isPathObject, isPathValue, setValueByPath } from './utils';
export interface ActionContextItemV08 {
key: string;
value: {
path: string;
} | {
literalString: string;
} | unknown;
}
export interface ActionConfigV08 {
name?: string;
context?: ActionContextItemV08[] | unknown;
[key: string]: unknown;
}
export declare function isLiteralStringObject(val: unknown): val is {
literalString: string;
};
export declare function resolvePropsV08(props: Record<string, any>, dataModel: Record<string, any>): Record<string, any>;
export declare function extractDataUpdatesV08(action: ActionConfigV08 | undefined, componentContext: Record<string, any>): Array<{
path: string;
value: any;
}>;
export declare function applyDataModelUpdateV08(prevDataModel: Record<string, any>, contents: Array<{
key: string;
valueString?: string;
valueMap?: Array<{
key: string;
valueString: string;
}>;
}>): Record<string, any>;
export { getValueByPath, setValueByPath, isPathValue, isPathObject };