const GLSLLinker: {
loadModule:
(
code: string,
name?: string,
entry?: string,
compressed?: boolean,
) => ParsedModule,
loadModuleWithCache:
(
code: string,
name?: string,
entry?: string,
cache?: ParsedModuleCache | null,
) => ParsedModule,
loadStaticModule:
(
code: string,
name: string,
entry?: string,
) => {
name: string,
code: string,
hash: number,
table: any,
label: string,
},
transpileGLSL:
(
source: string,
resourcePath: string,
options?: TranspileOptions,
) => TranspileOutput,
bindEntryPoint:
<T extends ParsedModule | ParsedBundle>(
bundle: T,
entry?: string,
) => T,
bundleToAttribute:
(
shader: ShaderModule,
name?: string,
) => UniformAttribute,
bundleToAttributes: (
shader: ShaderModule,
) => UniformAttribute[],
glsl:
(
literals: TemplateStringsArray,
...tokens: string[],
) => ParsedModule,
float: (x: number) => string | 0,
int: (x: number) => string,
uint: (x: number) => string,
defineConstants: (
defs: Record<string, ShaderDefine>,
) => string,
linkBundle:
(
source: ShaderModule,
links?: Record<string,
ParsedModule<any> | ParsedBundle<any> | null | undefined>,
defines?: Record<string, ShaderDefine>,
) => string,
linkModule:
(
source: ParsedModule,
libraries?: Record<string, ShaderModule>,
links?: Record<string,
ParsedModule<any> | ParsedBundle<any> | null | undefined>,
defines?: Record<string, ShaderDefine>,
) => string,
linkCode:
(
code: string,
libraries?: Record<string, string>,
links?: Record<string, string | null>,
defines?: Record<string, ShaderDefine>,
cache?: ParsedModuleCache | null,
) => string,
getPreamble: () => string,
setPreamble: (s: string) => string,
bindBundle:
(
subject: ShaderModule,
links?:
| Record<string, ParsedModule<any> | ParsedBundle<any> | null | undefined>
| null,
defines?: Record<string, ShaderDefine> | null,
) => ParsedBundle,
bindModule:
(
subject: ShaderModule,
links?:
| Record<string, ParsedModule<any> | ParsedBundle<any> | null | undefined>
| null,
defines?: Record<string, ShaderDefine> | null,
) => ParsedBundle,
bindingsToLinks:
(
bindings: ({
uniform: UniformAttribute,
storage?: StorageSource,
texture?: TextureSource,
lambda?:
LambdaSource<ShaderModule<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>>,
constant?: any,
})[],
) => Record<string,
| ParsedBundle<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }> | ParsedModule<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>>,
bindingToModule:
(
binding: {
uniform: UniformAttribute,
storage?: StorageSource,
texture?: TextureSource,
lambda?:
LambdaSource<ShaderModule<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>>,
constant?: any,
},
) =>
| ParsedBundle<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>
| ParsedModule<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>,
sourceToModule:
<T>(
source: any,
) =>
| ParsedBundle<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>
| ParsedModule<{ modules?: ({ at: number, symbols: string[] } & { name: string, imports: ImportRef[] })[], declarations?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], externals?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], exports?: ({ at: number, symbols: string[] } & { func?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, parameters: string[] }, variable?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, locals: ({ name: string, expr: any })[] }, struct?: { type: { name: string, qualifiers?: string[], members?: ({ type: { }, name: string })[] }, name: string, struct: { members: ({ type: { name: string, qualifiers?: string[], members?: ({ })[] }, name: string })[] } }, identifiers?: string[], flags: RefFlags })[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>
| null,
resolveBindings: any,
castTo:
(
source: ShaderModule,
type: string,
swizzle?: string | { basis: string, signs?: string, gain?: number } | null,
) => ParsedBundle,
chainTo: (
from: ShaderModule,
to: ShaderModule,
) => ParsedBundle,
diffBy:
(
source: ShaderModule,
offset: number | string | (string | number | null)[] | null,
size:
| ShaderModule
| (ParsedModule<any> | ParsedBundle<any> | null)[]
| null,
) => ParsedBundle,
explode:
(
struct: ShaderModule,
source: ShaderModule,
) => ParsedBundle,
swizzleTo:
(
from: string,
to: string,
swizzle: string | { basis: string, signs?: string, gain?: number },
) => ParsedBundle,
structType:
(
fields: UniformAttribute[],
name?: string,
) => ParsedBundle,
makeASTParser:
(
code: string,
tree: Tree,
name?: string,
) => {
getImports:
() => ({
at: number,
symbols: string[],
} & {
name: string,
imports: ImportRef[],
})[],
getFunctions:
() => ({
at: number,
symbols: string[],
} & {
func: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
identifiers?: string[],
flags: RefFlags,
})[],
getDeclarations:
() => ({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
getSymbolTable:
() => {
modules?:
({
at: number,
symbols: string[],
} & {
name: string,
imports: ImportRef[],
})[],
declarations?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
externals?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
exports?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
symbols?: string[],
types?: string[],
visibles?: string[],
globals?: string[],
linkable?: Record<string, true>,
},
getShakeTable:
(
table?: {
modules?:
({
at: number,
symbols: string[],
} & {
name: string,
imports: ImportRef[],
})[],
declarations?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
externals?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
exports?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
symbols?: string[],
types?: string[],
visibles?: string[],
globals?: string[],
linkable?: Record<string, true>,
},
) => ShakeTable | undefined,
},
compressAST:
(
code: string,
tree: Tree,
symbols?: string[],
modules?: ({
at: number,
symbols: string[],
} & {
name: string,
imports: ImportRef[],
})[],
) => CompressedNode[],
decompressAST:
(
nodes: CompressedNode[],
symbols?: string[],
) => Tree,
rewriteUsingAST:
(
code: string,
tree: Tree,
rename: Map<string, string>,
shake?: number[],
) => string,
makeModuleCache:
(
options?: Record<string, any>,
) => LRUCache<number,
{ name: string, code: string, hash: number, table: {
modules?:
({
at: number,
symbols: string[],
} & {
name: string,
imports: ImportRef[],
})[],
declarations?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
externals?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
exports?:
({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[],
symbols?: string[],
types?: string[],
visibles?: string[],
globals?: string[],
linkable?: Record<string, true>,
}, tree?: Tree, shake?: ShakeTable, virtual?: VirtualTable<{ modules?: ({
at: number,
symbols: string[],
} & {
name: string,
imports: ImportRef[],
})[], declarations?: ({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[], externals?: ({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[], exports?: ({
at: number,
symbols: string[],
} & {
func?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
parameters: string[],
},
variable?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
locals: ({ name: string, expr: any })[],
},
struct?: {
type: {
name: string,
qualifiers?: string[],
members?: ({ type: {
}, name: string })[],
},
name: string,
struct: {
members:
({
type: {
name: string,
qualifiers?: string[],
members?: ({ })[],
},
name: string,
})[],
},
},
identifiers?: string[],
flags: RefFlags,
})[], symbols?: string[], types?: string[], visibles?: string[], globals?: string[], linkable?: Record<string, true> }>, entry?: string, label?: string, key?: number }>,
getBundleEntry: (
bundle: ShaderModule,
) => string | undefined,
getBundleHash: (bundle: ShaderModule) => number,
getBundleKey: (bundle: ShaderModule) => number,
getBundleLabel: (bundle: ShaderModule) => string,
decompressString:
(
symbols: string[],
) => (s: (string | number)[]) => string[]
(s: string | number) => string,
symbolDictionary: {
A: "at",
B: "bindings",
E: "exports",
F: "func",
G: "flags",
H: "inferred",
I: "identifiers",
J: "imported",
K: "imports",
L: "linkable",
M: "members",
N: "name",
O: "modules",
P: "parameters",
Q: "qual",
R: "symbol",
S: "symbols",
T: "type",
U: "struct",
V: "variable",
W: "visibles",
X: "externals",
Y: "types",
Z: "attr",
},
parser: LRParser,
}
packages / shader / src / index.ts