import { IUniform } from 'three'; import { DynoType } from './types'; import { DynoVal, DynoValue, HasDynoOut } from './value'; export declare class Compilation { globals: Set; statements: string[]; uniforms: Record; declares: Set; updaters: (() => void)[]; sequence: number; indent: string; constructor({ indent }?: { indent?: string; }); nextSequence(): number; } export type IOTypes = Record; type GenerateContext = { inputs: { [K in keyof InTypes]?: string; }; outputs: { [K in keyof OutTypes]?: string; }; compile: Compilation; }; export declare class Dyno { inTypes: InTypes; outTypes: OutTypes; inputs: { [K in keyof InTypes]?: DynoVal; }; update?: () => void; globals?: ({ inputs, outputs, compile, }: GenerateContext) => string[]; statements?: ({ inputs, outputs, compile, }: GenerateContext) => string[]; generate: ({ inputs, outputs, compile, }: GenerateContext) => { globals?: string[]; statements?: string[]; uniforms?: Record; }; constructor({ inTypes, outTypes, inputs, update, globals, statements, generate, }: { inTypes?: InTypes; outTypes?: OutTypes; inputs?: { [K in keyof InTypes]?: DynoVal; }; update?: () => void; globals?: ({ inputs, outputs, compile, }: GenerateContext) => string[]; statements?: ({ inputs, outputs, compile, }: GenerateContext) => string[]; generate?: ({ inputs, outputs, compile, }: GenerateContext) => { globals?: string[]; statements?: string[]; uniforms?: Record; }; }); get outputs(): { [K in keyof OutTypes]: DynoVal; }; apply(inputs: { [K in keyof InTypes]?: DynoVal; }): { [K in keyof OutTypes]: DynoVal; }; compile({ inputs, outputs, compile, }: { inputs: { [K in keyof InTypes]?: string; }; outputs: { [K in keyof OutTypes]?: string; }; compile: Compilation; }): string[]; } export type DynoBlockType = (inputs: { [K in keyof InTypes]?: DynoVal; }, outputs: { [K in keyof OutTypes]?: DynoVal; }, { roots }: { roots: Dyno[]; }) => { [K in keyof OutTypes]?: DynoVal; } | undefined; export declare class DynoBlock extends Dyno { construct: DynoBlockType; constructor({ inTypes, outTypes, inputs, update, globals, construct, }: { inTypes?: InTypes; outTypes?: OutTypes; inputs?: { [K in keyof InTypes]?: DynoVal; }; update?: () => void; globals?: ({ inputs, outputs, compile, }: GenerateContext) => string[]; construct: DynoBlockType; }); generateBlock({ inputs, outputs, compile, }: { inputs: { [K in keyof InTypes]?: string; }; outputs: { [K in keyof OutTypes]?: string; }; compile: Compilation; }): { statements: string[]; }; } export declare function dynoBlock, OutTypes extends Record>(inTypes: InTypes, outTypes: OutTypes, construct: DynoBlockType, { update, globals }?: { update?: () => void; globals?: () => string[]; }): DynoBlock; export declare function dyno, OutTypes extends Record>({ inTypes, outTypes, inputs, update, globals, statements, generate, }: { inTypes: InTypes; outTypes: OutTypes; inputs?: { [K in keyof InTypes]?: DynoVal; }; update?: () => void; globals?: ({ inputs, outputs, compile, }: GenerateContext) => string[]; statements?: ({ inputs, outputs, compile, }: GenerateContext) => string[]; generate?: ({ inputs, outputs, compile, }: GenerateContext) => { globals?: string[]; statements?: string[]; uniforms?: Record; }; }): Dyno; export declare function dynoDeclare(name: string, type: DynoType, count?: number): string; export declare function unindentLines(s: string): string[]; export declare function unindent(s: string): string; export declare class UnaryOp extends Dyno<{ a: A; }, { [key in OutKey]: OutType; }> implements HasDynoOut { constructor({ a, outKey, outTypeFunc, }: { a: DynoVal; outKey: OutKey; outTypeFunc: (aType: A) => OutType; }); outKey: OutKey; dynoOut(): DynoValue; } export declare class BinaryOp extends Dyno<{ a: A; b: B; }, { [key in OutKey]: OutType; }> implements HasDynoOut { constructor({ a, b, outKey, outTypeFunc, }: { a: DynoVal; b: DynoVal; outKey: OutKey; outTypeFunc: (aType: A, bType: B) => OutType; }); outKey: OutKey; dynoOut(): DynoValue; } export declare class TrinaryOp extends Dyno<{ a: A; b: B; c: C; }, { [key in OutKey]: OutType; }> implements HasDynoOut { constructor({ a, b, c, outKey, outTypeFunc, }: { a: DynoVal; b: DynoVal; c: DynoVal; outKey: OutKey; outTypeFunc: (aType: A, bType: B, cType: C) => OutType; }); outKey: OutKey; dynoOut(): DynoValue; } export {};