/// import { BooleanType, ChoiceType, CustomType, DataSourceType, JSONLikeType, NumberType, StringType } from "./prop-types"; import { FunctionParam } from "./registerComponent"; export type PropType

= StringType

| BooleanType

| NumberType

| JSONLikeType

| ChoiceType

| DataSourceType

| CustomType

; type RestrictPropType = T extends string ? StringType

| ChoiceType

| JSONLikeType

| CustomType

: T extends boolean ? BooleanType

| JSONLikeType

| CustomType

: T extends number ? NumberType

| JSONLikeType

| CustomType

: PropType

; type DistributedKeyOf = T extends any ? keyof T : never; export interface GlobalContextMeta

{ /** * 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>; } export interface GlobalContextRegistration { component: React.ComponentType; meta: GlobalContextMeta; } export interface GlobalActionRegistration

{ displayName?: string; description?: string; parameters: FunctionParam

[]; } declare global { interface Window { __PlasmicContextRegistry: GlobalContextRegistration[]; } } export default function registerGlobalContext>(component: T, meta: GlobalContextMeta>): void; export {};