///
= StringType
| BooleanType
| NumberType
| JSONLikeType
| ChoiceType
| DataSourceType
| CustomType
;
type RestrictPropType | ChoiceType | JSONLikeType | CustomType : T extends boolean ? BooleanType | JSONLikeType | CustomType : T extends number ? NumberType | JSONLikeType | CustomType : PropType ;
type DistributedKeyOf {
/**
* Any unique string name used to identify that context. Each context
* should be registered with a different `meta.name`, even if they have the
* same name in the code.
*/
name: string;
/**
* The name to be displayed for the context in Studio. Optional: if not
* specified, `meta.name` is used.
*/
displayName?: string;
/**
* The description of the context to be shown in Studio.
*/
description?: string;
/**
* The javascript name to be used when generating code. Optional: if not
* provided, `meta.name` is used.
*/
importName?: string;
/**
* An object describing the context properties to be used in Studio.
* For each `prop`, there should be an entry `meta.props[prop]` describing
* its type.
*/
props: {
[prop in DistributedKeyOf ]?: RestrictPropType ;
} & {
[prop: string]: PropType ;
};
/**
* The path to be used when importing the context in the generated code.
* It can be the name of the package that contains the context, or the path
* to the file in the project (relative to the root directory).
*/
importPath: string;
/**
* Whether the context is the default export from that path. Optional: if
* not specified, it's considered `false`.
*/
isDefaultExport?: boolean;
/**
* The prop that receives and forwards a React `ref`. Plasmic only uses `ref`
* to interact with components, so it's not used in the generated code.
* Optional: If not provided, the usual `ref` is used.
*/
refProp?: string;
/**
* Whether the global context provides data to its children using DataProvider.
*/
providesData?: boolean;
globalActions?: Record {
displayName?: string;
description?: string;
parameters: FunctionParam [];
}
declare global {
interface Window {
__PlasmicContextRegistry: GlobalContextRegistration[];
}
}
export default function registerGlobalContext