import { ManifestV2, PersonalizationEvent, TestEvent, CompositionMetadata, Quirks, ScoreVector } from '@uniformdev/context'; import * as react from 'react'; import { ReactNode, PropsWithChildren } from 'react'; import { PureContextualEditingComponentWrapperProps } from '@uniformdev/canvas-react/core'; import * as _uniformdev_canvas_next_rsc_shared from '@uniformdev/canvas-next-rsc-shared'; import { AppDirectoryContextState, ComponentProps, PersonalizeProps, TestProps, CreateUniformContextOptions, AppDirectoryContext } from '@uniformdev/canvas-next-rsc-shared'; import { VisibilityParameterValue, ComponentInstance, UpdateContextualEditingStateInternalMessage } from '@uniformdev/canvas'; type ClientContextComponentProps = { /** * The Uniform project manifest */ manifest: ManifestV2; /** * Whether or not to disable the Uniform Context dev tools */ disableDevTools: boolean; /** * The default consent value */ defaultConsent: boolean; /** * @deprecated * Whether or not to enable the experimental quirk serialization */ experimentalQuirkSerialization: boolean; }; type ClientContextComponent = (props: ClientContextComponentProps) => ReactNode; declare const ClientContextPersonalizationTransfer: ({ event, ts, }: { event: PersonalizationEvent; ts: number; }) => null; declare const ClientContextTestTransfer: ({ event, ts }: { event: TestEvent; ts: number; }) => null; declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren) => react.JSX.Element; declare const ClientContextUpdate: ({ path, compositionMetadata, }: { path: string; compositionMetadata: CompositionMetadata; }) => react.JSX.Element; declare const ContextUpdateTransferClient: ({ update, ts, }: { update: Partial; ts: number; }) => null; declare const DefaultUniformClientContext: ClientContextComponent; interface PersonalizeClientProps extends ComponentProps { indexes: number[]; } declare const PersonalizeClient: (props: PersonalizeClientProps) => react.FunctionComponentElement; declare const TestClient: (props: ComponentProps) => react.FunctionComponentElement | null; declare const UniformScript: () => react.JSX.Element; declare const VisibilityRulesWrapperClient: ({ parameter, initialIsVisible, children, }: PropsWithChildren<{ parameter: VisibilityParameterValue; initialIsVisible: boolean | null; }>) => react.JSX.Element | null; type CreateClientUniformContextOptions = Omit; declare const createClientUniformContext: (options: CreateClientUniformContextOptions) => _uniformdev_canvas_next_rsc_shared.AppDirectoryContextInstance; declare const useInitUniformContext: (callback: () => AppDirectoryContext) => void; /** * Provides reactive access to the Uniform Context's current visitor quirks values * This can be used when you want to read current quirk values directly. */ declare function useQuirks(): Quirks; /** * Provides reactive access to the Uniform Context's current visitor scores values. * This can be used when you want to read current score values directly. */ declare function useScores(): ScoreVector | undefined; declare global { interface Window { __UNIFORM_CONTEXT__: AppDirectoryContext | undefined; } } declare const useUniformContext: () => { context: AppDirectoryContext | undefined; }; type UseUniformContextualEditingStateProps = { /** * When not set, the hook will return the global contextual state no matter where its used. * When set, it will return only the state relevant to the component passed. * @default undefined **/ scope?: ComponentInstance; }; type UseUniformContextualEditingStateReturnType = { /** * A reference to the currently selected component in Canvas editor. * Returns `undefined` if the selected component is not part of the current React component. * Set the `scope` option a component instance to limit the scope of selected compponents. */ selectedComponentReference: UpdateContextualEditingStateInternalMessage['state']['selectedComponentReference']; }; declare const useUniformContextualEditingState: ({ scope, }?: UseUniformContextualEditingStateProps) => UseUniformContextualEditingStateReturnType; export { type ClientContextComponent, type ClientContextComponentProps, ClientContextPersonalizationTransfer, ClientContextTestTransfer, ClientContextUpdate, ClientContextualEditingComponentWrapper, ContextUpdateTransferClient, type CreateClientUniformContextOptions, DefaultUniformClientContext, PersonalizeClient, type PersonalizeClientProps, TestClient, UniformScript, type UseUniformContextualEditingStateProps, type UseUniformContextualEditingStateReturnType, VisibilityRulesWrapperClient, createClientUniformContext, useInitUniformContext, useQuirks, useScores, useUniformContext, useUniformContextualEditingState };