1 | import { Component, ComponentManager } from './ComponentManager';
|
2 | import { gl } from './components/renderer/gl';
|
3 | export type { IAttribute, IAttributeInitializationOptions, } from './components/renderer/IAttribute';
|
4 | export type { IBuffer, IBufferInitializationOptions, } from './components/renderer/IBuffer';
|
5 | export type { IComputeModel } from './components/renderer/IComputeModel';
|
6 | export type { IElements, IElementsInitializationOptions, } from './components/renderer/IElements';
|
7 | export type { IFramebuffer, IFramebufferInitializationOptions, } from './components/renderer/IFramebuffer';
|
8 | export type { IModel, IModelDrawOptions, IModelInitializationOptions, } from './components/renderer/IModel';
|
9 | export type { IRenderbuffer, IRenderbufferInitializationOptions, } from './components/renderer/IRenderbuffer';
|
10 | export type { BufferData, IClearOptions, IReadPixelsOptions, IRendererConfig, IRendererService, IViewport, } from './components/renderer/IRendererService';
|
11 | export type { ITexture2D, ITexture2DInitializationOptions, } from './components/renderer/ITexture2D';
|
12 | export type { IUniform } from './components/renderer/IUniform';
|
13 | import { createEntity } from './Entity';
|
14 | import { ConfigService } from './services/config/ConfigService';
|
15 | export type { IConfig, IConfigService } from './services/config/IConfigService';
|
16 | export type { IShaderModuleService } from './services/shader-module/IShaderModuleService';
|
17 | import { isSafari } from './utils/isSafari';
|
18 | declare type Entity = number;
|
19 | declare enum AST_TOKEN_TYPES {
|
20 | Void = "Void",
|
21 | Boolean = "Boolean",
|
22 | Float = "Float",
|
23 | Uint32 = "Uint32",
|
24 | Int32 = "Int32",
|
25 | Vector = "Vector",
|
26 | Vector2Float = "vec2<f32>",
|
27 | Vector3Float = "vec3<f32>",
|
28 | Vector4Float = "vec4<f32>",
|
29 | Vector2Boolean = "vec2<bool>",
|
30 | Vector3Boolean = "vec3<bool>",
|
31 | Vector4Boolean = "vec4<bool>",
|
32 | Vector2Uint = "vec2<u32>",
|
33 | Vector3Uint = "vec3<u32>",
|
34 | Vector4Uint = "vec4<u32>",
|
35 | Vector2Int = "vec2<i32>",
|
36 | Vector3Int = "vec3<i32>",
|
37 | Vector4Int = "vec4<i32>",
|
38 | Matrix = "Matrix",
|
39 | Matrix3x3Float = "mat3x3<f32>",
|
40 | Matrix4x4Float = "mat4x4<i32>",
|
41 | Struct = "Struct",
|
42 | FloatArray = "Float[]",
|
43 | Vector4FloatArray = "vec4<f32>[]"
|
44 | }
|
45 | declare enum AST_NODE_TYPES {
|
46 | Program = "Program",
|
47 | Identifier = "Identifier",
|
48 | VariableDeclaration = "VariableDeclaration",
|
49 | BlockStatement = "BlockStatement",
|
50 | ReturnStatement = "ReturnStatement",
|
51 | FunctionDeclaration = "FunctionDeclaration",
|
52 | VariableDeclarator = "VariableDeclarator",
|
53 | AssignmentExpression = "AssignmentExpression",
|
54 | LogicalExpression = "LogicalExpression",
|
55 | BinaryExpression = "BinaryExpression",
|
56 | ArrayExpression = "ArrayExpression",
|
57 | UnaryExpression = "UnaryExpression",
|
58 | UpdateExpression = "UpdateExpression",
|
59 | FunctionExpression = "FunctionExpression",
|
60 | MemberExpression = "MemberExpression",
|
61 | ConditionalExpression = "ConditionalExpression",
|
62 | ExpressionStatement = "ExpressionStatement",
|
63 | CallExpression = "CallExpression",
|
64 | NumThreadStatement = "NumThreadStatement",
|
65 | StorageStatement = "StorageStatement",
|
66 | DoWhileStatement = "DoWhileStatement",
|
67 | WhileStatement = "WhileStatement",
|
68 | ForStatement = "ForStatement",
|
69 | BreakStatement = "BreakStatement",
|
70 | ContinueStatement = "ContinueStatement",
|
71 | IfStatement = "IfStatement",
|
72 | ImportedFunctionStatement = "ImportedFunctionStatement"
|
73 | }
|
74 | declare enum STORAGE_CLASS {
|
75 | Input = "Input",
|
76 | Output = "Output",
|
77 | Uniform = "Uniform",
|
78 | Workgroup = "Workgroup",
|
79 | UniformConstant = "UniformConstant",
|
80 | Image = "Image",
|
81 | StorageBuffer = "StorageBuffer",
|
82 | Private = "Private",
|
83 | Function = "Function"
|
84 | }
|
85 | declare type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
|
86 | declare type DataType = AST_TOKEN_TYPES.Uint32 | AST_TOKEN_TYPES.Int32 | AST_TOKEN_TYPES.Boolean | AST_TOKEN_TYPES.Float | AST_TOKEN_TYPES.Vector2Float | AST_TOKEN_TYPES.Vector3Float | AST_TOKEN_TYPES.Vector4Float | AST_TOKEN_TYPES.Vector2Int | AST_TOKEN_TYPES.Vector3Int | AST_TOKEN_TYPES.Vector4Int | AST_TOKEN_TYPES.Vector2Uint | AST_TOKEN_TYPES.Vector3Uint | AST_TOKEN_TYPES.Vector4Uint | AST_TOKEN_TYPES.Vector2Boolean | AST_TOKEN_TYPES.Vector3Boolean | AST_TOKEN_TYPES.Vector4Boolean | AST_TOKEN_TYPES.Matrix3x3Float | AST_TOKEN_TYPES.Matrix4x4Float | AST_TOKEN_TYPES.FloatArray | AST_TOKEN_TYPES.Vector4FloatArray | AST_TOKEN_TYPES.Void;
|
87 | interface GLSLContext {
|
88 | |
89 |
|
90 |
|
91 | name: string;
|
92 | shader?: string;
|
93 | |
94 |
|
95 |
|
96 |
|
97 |
|
98 | dispatch: [number, number, number];
|
99 | |
100 |
|
101 |
|
102 |
|
103 | threadGroupSize: [number, number, number];
|
104 | |
105 |
|
106 |
|
107 | maxIteration: number;
|
108 | |
109 |
|
110 |
|
111 | needPingpong: boolean;
|
112 | |
113 |
|
114 |
|
115 | output: {
|
116 | name: string;
|
117 | size?: [number, number];
|
118 | textureSize?: [number, number];
|
119 | length?: number;
|
120 | typedArrayConstructor?: TypedArrayConstructor;
|
121 | gpuBuffer?: any;
|
122 | outputElementsPerTexel?: number;
|
123 | };
|
124 | |
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 | defines: Array<{
|
131 | name: string;
|
132 | type: DataType;
|
133 | value: number;
|
134 | runtime: boolean;
|
135 | }>;
|
136 | globalDeclarations: Array<{
|
137 | name: string;
|
138 | type: DataType;
|
139 | value: string;
|
140 | shared: boolean;
|
141 | }>;
|
142 | uniforms: Array<{
|
143 | name: string;
|
144 | type: DataType;
|
145 | data?: number | number[] | Float32Array | Uint8Array | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array;
|
146 | size?: [number, number];
|
147 | storageClass: STORAGE_CLASS;
|
148 | readonly: boolean;
|
149 | writeonly: boolean;
|
150 | isReferer?: boolean;
|
151 | }>;
|
152 | }
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 | declare enum Target {
|
160 | GLSL100 = "GLSL100",
|
161 | GLSL450 = "GLSL450",
|
162 | WGSL = "WGSL"
|
163 | }
|
164 | declare const DefineValuePlaceholder = "__DefineValuePlaceholder__";
|
165 | interface KernelBundle {
|
166 | shaders: {
|
167 | [Target.WGSL]: string;
|
168 | [Target.GLSL450]: string;
|
169 | [Target.GLSL100]: string;
|
170 | };
|
171 | context?: GLSLContext;
|
172 | toString(): string;
|
173 | }
|
174 | export { createEntity, Component, ComponentManager, Entity, isSafari, gl, ConfigService, AST_TOKEN_TYPES, AST_NODE_TYPES, STORAGE_CLASS, GLSLContext, DataType, Target, DefineValuePlaceholder, KernelBundle, };
|