nuxt
Version:
17 lines (16 loc) • 572 B
TypeScript
interface Preview {
enabled: boolean;
state: Record<any, unknown>;
_initialized?: boolean;
}
interface PreviewModeOptions<S> {
shouldEnable?: (state: Preview['state']) => boolean;
getState?: (state: Preview['state']) => S;
}
type EnteredState = Record<any, unknown> | null | undefined | void;
/** @since 3.11.0 */
export declare function usePreviewMode<S extends EnteredState>(options?: PreviewModeOptions<S>): {
enabled: import("vue").Ref<boolean>;
state: S extends void ? Preview["state"] : (NonNullable<S> & Preview["state"]);
};
export {};