import type { FragmentVNode, FragmentVNodeWithChildren, MarshalledVNode, SourceReferenceVNode, VNode } from "./vnode"; import type { SourceReference } from "./source-reference"; import type { Fragment } from "./fragment"; declare type GetLength = T extends { length: infer L; } ? L : never; /** * @experimental This may go away */ export declare const Instance: unique symbol; /** * @experimental This may not be available all the time, and this functionality may disappear. */ export declare const ChildrenSource: unique symbol; /** * @experimental This may not be available all the time, and this functionality may disappear. */ export declare const ChildrenSourceFunction: unique symbol; export declare type CreateNodeChildrenWithSourceType = AsyncIterable & { /** * @experimental This may not be available all the time, and this functionality may disappear. */ [ChildrenSource]?: C; }; declare type IfChildren = 0 extends GetLength ? K : C extends never[] ? K : Z; export declare type CreateNodeChildren = IfChildren>; declare type Options = Record | object | undefined; declare type MaxDepth = 8; declare type CreateNodeResultCoreOp1 = Omit & { source: T; children: CreateNodeChildrenWithSourceType>[]>; }; declare type CreateNodeResultCoreOp2 = Omit & { source: T; children: CreateNodeChildrenWithSourceType[]>; }; declare type CreateNodeResultCoreOp3 = CreateNodeResult; declare type CreateNodeResultCoreOp4 = Omit & { options: T["options"] extends O ? O : T["options"] & O; children: T["children"] extends AsyncIterable ? T["children"] : CreateNodeChildren[]>; }; declare type CreateNodeResultCoreOp5 = VNode; declare type CreateNodeResultCoreOp6 = Omit & { source: T; scalar: IfChildren; options: O; children: CreateNodeChildren[]>; }; declare type CreateNodeResultCoreOp7 = Omit & { options: O; }; declare type CreateNodeResultCoreOp8 = Omit & { options: O; children: T extends AsyncIterable ? AsyncIterable[]> : T extends Iterable ? AsyncIterable[]> : never; }; declare type CreateNodeResultCoreOp9 = Omit & { source: undefined; }; /** * @experimental */ export declare type CreateNodeResultCore = T extends CreateNodeOp1Function ? CreateNodeResultCoreOp1 : T extends CreateNodeOp2Promise ? CreateNodeResultCoreOp2 : T extends CreateNodeOp3Fragment ? CreateNodeResultCoreOp3 : T extends CreateNodeOp4VNode ? CreateNodeResultCoreOp4 : T extends CreateNodeOp5MarshalledVNode ? CreateNodeResultCoreOp5 : T extends CreateNodeOp6SourceReference ? CreateNodeResultCoreOp6 : T extends CreateNodeOp7IterableIterator ? CreateNodeResultCoreOp7 : T extends CreateNodeOp8Iterable ? CreateNodeResultCoreOp8 : T extends CreateNodeOp9Falsy ? CreateNodeResultCoreOp9 : T extends CreateNodeOp9000ExplicitExceptionCaseForObject ? never : never; /** * @experimental */ export declare type CreateNodeResult = VNode & CreateNodeResultCore; export interface CreateNodeOp1Function { (options?: unknown, children?: VNode): T; } export declare type CreateNodeOp2Promise = Promise; export declare type CreateNodeOp3Fragment = typeof Fragment; export declare type CreateNodeOp4VNode = VNode; export declare type CreateNodeOp5MarshalledVNode = MarshalledVNode; export declare type CreateNodeOp6SourceReference = SourceReference; export declare type CreateNodeOp7IterableIterator = IterableIterator | AsyncIterableIterator; export declare type CreateNodeOp8Iterable = Iterable | AsyncIterable; export declare type CreateNodeOp9Falsy = undefined | null; export declare type CreateNodeOp9000ExplicitExceptionCaseForObject = object; export declare type Source = CreateNodeOp1Function | CreateNodeOp2Promise | CreateNodeOp3Fragment | CreateNodeOp4VNode | CreateNodeOp5MarshalledVNode | CreateNodeOp6SourceReference | CreateNodeOp7IterableIterator | CreateNodeOp8Iterable | CreateNodeOp9Falsy | CreateNodeOp9000ExplicitExceptionCaseForObject; interface VNodeWithChildrenSourceType { children: CreateNodeChildrenWithSourceType; } export declare type InferChildrenSource; }> = V extends VNodeWithChildrenSourceType ? C : []; declare type ChildrenResult = CValue extends ChildrenOp1Undefined ? never : CValue extends ChildrenOp2Fragment ? undefined extends CValue["children"] ? never : CValue["children"] extends AsyncIterable> ? ChildrenResult : never : CValue extends ChildrenOp3VNode ? CValue : CValue extends ChildrenOp4SourceReference ? SourceReferenceVNode : CValue extends ChildrenOp5IterableIterator ? CValue extends IterableIterator ? ChildrenResult : never : CValue extends ChildrenOp6Promise ? CValue extends Promise ? ChildrenResult : never : CValue extends ChildrenOp7Iterable ? CValue extends Iterable ? ChildrenResult : CValue extends AsyncIterable ? ChildrenResult : never : never; export declare type VNodeChildrenFromSource; }> = VNodeWithChildrenFromSource["children"]; /** * @experimental This type may be removed */ export declare type VNodeWithChildrenFromSource; }> = Omit & { children: V extends { children: AsyncIterable; } ? Z extends VNode ? CreateNodeChildrenWithSourceType, Z[]> : never : never; }; declare type ChildrenOp1Undefined = undefined; declare type ChildrenOp2Fragment = FragmentVNode; declare type ChildrenOp3VNode = { reference: SourceReference; }; declare type ChildrenOp4SourceReference = SourceReference; declare type ChildrenOp5IterableIterator = IterableIterator; declare type ChildrenOp7Iterable = Iterable | AsyncIterable; declare type ChildrenOp6Promise = Promise; export {}; //# sourceMappingURL=source.d.ts.map