@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
16 lines (15 loc) • 591 B
TypeScript
import { Ref } from 'vue';
export type UseJsonRecordValue = Record<string, unknown>;
export type UseJsonRecord = {
valid: Ref<boolean>;
json: Ref<string>;
record: Ref<UseJsonRecordValue>;
};
/**
* The UseJsonRecord composition takes a record or record-parsable string
* and creates two reactive references: a string and an object.
* It then sets up watchers to sync changes between these two references.
* @param initialValues UseJsonRecordValue
* @returns UseJsonRecord
*/
export declare function useJsonRecord(initialValues?: UseJsonRecordValue | string): UseJsonRecord;