Skip to content

Latest commit

 

History

History
320 lines (255 loc) · 10 KB

api.md

File metadata and controls

320 lines (255 loc) · 10 KB

API Report File for "@builder.io/qwik"

Do not edit this file. It is a report generated by API Extractor.

// @public
export function $<T>(expression: T): QRL<T>;

// Warning: (ae-forgotten-export) The symbol "AsyncProps" needs to be exported by the entry point index.d.ts
//
// @public
export function Async<T>(props: AsyncProps<T>): JSXNode<any>;

// @public (undocumented)
export function bubble<PAYLOAD>(eventType: string, payload?: PAYLOAD): void;

// Warning: (ae-forgotten-export) The symbol "ComponentBaseProps" needs to be exported by the entry point index.d.ts
//
// @public
export function component$<PROPS extends {}>(onMount: OnMountFn<PROPS>, options?: ComponentOptions): (props: PROPS & ComponentBaseProps) => JSXNode<PROPS>;

// @public
export function component<PROPS extends {}>(onMount: QRL<OnMountFn<PROPS>>, options?: ComponentOptions): (props: PROPS & ComponentBaseProps) => JSXNode<PROPS>;

// @public (undocumented)
export type ComponentChild = JSXNode<any> | object | string | number | bigint | boolean | null | undefined;

// @public (undocumented)
export type ComponentChildren = ComponentChild[] | ComponentChild;

// @public (undocumented)
export interface ComponentOptions {
    // (undocumented)
    tagName?: string;
}

// @public (undocumented)
export interface CorePlatform {
    chunkForSymbol: (symbolName: string) => string | undefined;
    importSymbol: (element: Element, url: string | URL, symbol: string) => Promise<any>;
    // (undocumented)
    nextTick: (fn: () => any) => Promise<any>;
    raf: (fn: () => any) => Promise<any>;
}

// @public
export function createStore<STATE extends {}>(initialState: STATE): STATE;

// @public (undocumented)
export function dehydrate(document: Document): void;

// @public (undocumented)
export const Fragment: FunctionComponent<{
    children?: any;
}>;

// @public (undocumented)
export interface FunctionComponent<P = {}> {
    // (undocumented)
    (props: P, key?: string): JSXNode | null;
}

// @public (undocumented)
export const getPlatform: (docOrNode: Document | Node) => CorePlatform;

// @public (undocumented)
export function h<PROPS extends {} = {}>(type: string | FunctionComponent<PROPS>, props: PROPS | null, ...children: any[]): JSXNode;

// @public (undocumented)
export namespace h {
    // (undocumented)
    export function h(type: any): JSXNode<any>;
    // (undocumented)
    export function h(type: Node, data: any): JSXNode<any>;
    // (undocumented)
    export function h(type: any, text: string): JSXNode<any>;
    // (undocumented)
    export function h(type: any, children: Array<any>): JSXNode<any>;
    // (undocumented)
    export function h(type: any, data: any, text: string): JSXNode<any>;
    // (undocumented)
    export function h(type: any, data: any, children: Array<JSXNode<any> | undefined | null>): JSXNode<any>;
    // (undocumented)
    export function h(sel: any, data: any | null, children: JSXNode<any>): JSXNode<any>;
    // (undocumented)
    export namespace JSX {
        // (undocumented)
        export interface Element extends QwikJSX.Element {
        }
        // (undocumented)
        export interface ElementChildrenAttribute {
            // (undocumented)
            children?: any;
        }
        // (undocumented)
        export interface IntrinsicAttributes extends QwikJSX.IntrinsicAttributes {
        }
        // (undocumented)
        export interface IntrinsicElements extends QwikJSX.IntrinsicElements {
        }
    }
}

// @public
export const Host: FunctionComponent<Record<string, any>>;

// @public
export function implicit$FirstArg<FIRST, REST extends any[], RET>(fn: (first: QRL<FIRST>, ...rest: REST) => RET): (first: FIRST, ...rest: REST) => RET;

// @public (undocumented)
function jsx<T extends string | FunctionComponent<PROPS>, PROPS>(type: T, props: PROPS, key?: string | number): JSXNode<T>;
export { jsx }
export { jsx as jsxDEV }
export { jsx as jsxs }

// @public (undocumented)
export type JSXFactory<T, PROPS extends {} = any> = (props: PROPS, state?: any) => JSXNode<T>;

// @public (undocumented)
export interface JSXNode<T = any> {
    // (undocumented)
    children: JSXNode[];
    // (undocumented)
    elm?: Node;
    // (undocumented)
    key: string | null;
    // (undocumented)
    props: Record<string, any> | null;
    // (undocumented)
    text?: string;
    // (undocumented)
    type: T;
}

// Warning: (ae-forgotten-export) The symbol "RenderContext" needs to be exported by the entry point index.d.ts
//
// @public
export function notifyRender(hostElement: Element): Promise<RenderContext>;

// @public
export interface Observer {
    <T extends {}>(obj: T): T;
}

// @public
export function on(event: string, eventFn: QRL<() => void>): QRL<() => void>;

// @public
export const onDehydrate$: (first: () => void) => void;

// @public
export function onDehydrate(dehydrateFn: QRL<() => void>): void;

// @public
export function onDocument(event: string, eventFn: QRL<() => void>): QRL<() => void>;

// @public
export const onHydrate$: (first: () => void) => void;

// @public
export function onHydrate(hydrateFn: QRL<() => void>): void;

// @public (undocumented)
export type OnMountFn<PROPS> = (props: PROPS) => ValueOrPromise<QRL<() => ValueOrPromise<JSXNode<any>>>>;

// @public
export const onResume$: (first: () => void) => void;

// @public
export function onResume(resumeFn: QRL<() => void>): void;

// @public
export const onUnmount$: (first: () => void) => void;

// @public
export function onUnmount(unmountFn: QRL<() => void>): void;

// @public
export const onWatch$: (first: (obs: Observer) => unknown | (() => void)) => void;

// @public
export function onWatch(watchFn: QRL<(obs: Observer) => unknown | (() => void)>): void;

// @public
export function onWindow(event: string, eventFn: QRL<() => void>): QRL<() => void>;

// @public
export type PromiseValue<T> = {
    readonly isPending: true;
    readonly isResolved: false;
    readonly isRejected: false;
    readonly value: undefined;
    readonly rejection: undefined;
} | {
    readonly isPending: false;
    readonly isResolved: true;
    readonly isRejected: false;
    readonly value: T;
    readonly rejection: undefined;
} | {
    readonly isPending: false;
    readonly isResolved: false;
    readonly isRejected: true;
    readonly value: undefined;
    readonly rejection: any;
};

// @public (undocumented)
export type Props<T extends {} = {}> = Record<string, any> & T;

// @public
export type PropsOf<COMP extends (props: any) => JSXNode> = COMP extends (props: infer PROPS) => JSXNode<any> ? PROPS : never;

// @public
export interface QRL<TYPE = any> {
    // (undocumented)
    __brand__QRL__: TYPE;
}

// @public
export const qrl: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, lexicalScopeCapture?: any[]) => QRL<T>;

// @public
export function qrlImport<T>(element: Element, qrl: QRL<T>): Promise<T>;

// Warning: (ae-forgotten-export) The symbol "DOMAttributes" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export interface QwikDOMAttributes extends DOMAttributes<any> {
}

// Warning: (ae-forgotten-export) The symbol "IntrinsicElements" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export interface QwikIntrinsicElements extends IntrinsicElements {
    // Warning: (ae-forgotten-export) The symbol "QwikCustomHTMLAttributes" needs to be exported by the entry point index.d.ts
    // Warning: (ae-forgotten-export) The symbol "QwikCustomHTMLElement" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    [key: string]: QwikCustomHTMLAttributes<QwikCustomHTMLElement>;
    // Warning: (ae-forgotten-export) The symbol "QwikScriptHTMLAttributes" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    script: QwikScriptHTMLAttributes<HTMLScriptElement>;
}

// @public (undocumented)
export namespace QwikJSX {
    // (undocumented)
    export interface Element extends JSXNode {
    }
    // (undocumented)
    export interface ElementChildrenAttribute {
        // (undocumented)
        children: any;
    }
    // Warning: (ae-forgotten-export) The symbol "QwikIntrinsicAttributes" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    export interface IntrinsicAttributes extends QwikIntrinsicAttributes {
    }
    // (undocumented)
    export interface IntrinsicElements extends QwikIntrinsicElements {
    }
}

// @public
export function render(parent: Element | Document, jsxNode: JSXNode<unknown> | FunctionComponent<any>): ValueOrPromise<RenderContext>;

// @public (undocumented)
export type RenderableProps<P, RefType = any> = P & Readonly<{
    children?: ComponentChildren;
}>;

// @public (undocumented)
export const setPlatform: (doc: Document, plt: CorePlatform) => CorePlatform;

// @public (undocumented)
export const Slot: FunctionComponent<{
    name?: string;
    children?: any;
}>;

// @public (undocumented)
export function useDocument(): Document;

// @public
export function useEvent<EVENT extends {}>(expectEventType?: string): EVENT;

// @public
export function useHostElement(): Element;

// @public
export function useLexicalScope<VARS extends any[]>(): VARS;

// @alpha (undocumented)
export const useScopedStyles$: (first: string) => void;

// @alpha (undocumented)
export function useScopedStyles(styles: QRL<string>): void;

// @alpha
export const useStyles$: (first: string) => void;

// @alpha
export function useStyles(styles: QRL<string>): void;

// @public (undocumented)
export function useTransient<OBJ, ARGS extends any[], RET>(obj: OBJ, factory: (this: OBJ, ...args: ARGS) => RET, ...args: ARGS): RET;

// @public
export type ValueOrPromise<T> = T | Promise<T>;

// @alpha (undocumented)
export const version: string;

// (No @packageDocumentation comment for this package)