mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Typescript add declare (#17483)
This commit is contained in:
@@ -94,9 +94,13 @@ export class LayoutGraphVertex {
|
||||
this.t = id;
|
||||
this.j = object;
|
||||
}
|
||||
/** Out edge list */
|
||||
readonly o: OutE[] = [];
|
||||
/** In edge list */
|
||||
readonly i: OutE[] = [];
|
||||
/** Polymorphic object Id */
|
||||
readonly t: LayoutGraphValue;
|
||||
/** Polymorphic object */
|
||||
j: LayoutGraphObject;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
@@ -374,9 +378,9 @@ export class UniformData {
|
||||
this.offset = offset;
|
||||
this.size = 0;
|
||||
}
|
||||
uniformID: number;
|
||||
uniformType: Type;
|
||||
offset: number;
|
||||
declare uniformID: number;
|
||||
declare uniformType: Type;
|
||||
declare offset: number;
|
||||
size = 0;
|
||||
}
|
||||
|
||||
@@ -400,9 +404,9 @@ export class DescriptorData {
|
||||
this.type = type;
|
||||
this.count = count;
|
||||
}
|
||||
descriptorID: number;
|
||||
type: Type;
|
||||
count: number;
|
||||
declare descriptorID: number;
|
||||
declare type: Type;
|
||||
declare count: number;
|
||||
}
|
||||
|
||||
export class DescriptorBlockData {
|
||||
@@ -418,10 +422,10 @@ export class DescriptorBlockData {
|
||||
this.capacity = capacity;
|
||||
this.descriptors.length = 0;
|
||||
}
|
||||
type: DescriptorTypeOrder;
|
||||
visibility: ShaderStageFlagBit;
|
||||
declare type: DescriptorTypeOrder;
|
||||
declare visibility: ShaderStageFlagBit;
|
||||
offset = 0;
|
||||
capacity: number;
|
||||
declare capacity: number;
|
||||
readonly descriptors: DescriptorData[] = [];
|
||||
}
|
||||
|
||||
@@ -451,13 +455,13 @@ export class DescriptorSetLayoutData {
|
||||
this.uniformBlocks.clear();
|
||||
this.bindingMap.clear();
|
||||
}
|
||||
slot: number;
|
||||
capacity: number;
|
||||
declare slot: number;
|
||||
declare capacity: number;
|
||||
uniformBlockCapacity = 0;
|
||||
samplerTextureCapacity = 0;
|
||||
readonly descriptorBlocks: DescriptorBlockData[];
|
||||
readonly uniformBlocks: Map<number, UniformBlock>;
|
||||
readonly bindingMap: Map<number, number>;
|
||||
declare readonly descriptorBlocks: DescriptorBlockData[];
|
||||
declare readonly uniformBlocks: Map<number, UniformBlock>;
|
||||
declare readonly bindingMap: Map<number, number>;
|
||||
}
|
||||
|
||||
export class DescriptorSetData {
|
||||
@@ -472,10 +476,10 @@ export class DescriptorSetData {
|
||||
this.descriptorSetLayout = descriptorSetLayout;
|
||||
this.descriptorSet = descriptorSet;
|
||||
}
|
||||
readonly descriptorSetLayoutData: DescriptorSetLayoutData;
|
||||
declare readonly descriptorSetLayoutData: DescriptorSetLayoutData;
|
||||
readonly descriptorSetLayoutInfo: DescriptorSetLayoutInfo = new DescriptorSetLayoutInfo();
|
||||
/*refcount*/ descriptorSetLayout: DescriptorSetLayout | null;
|
||||
/*refcount*/ descriptorSet: DescriptorSet | null;
|
||||
declare /*refcount*/ descriptorSetLayout: DescriptorSetLayout | null;
|
||||
declare /*refcount*/ descriptorSet: DescriptorSet | null;
|
||||
}
|
||||
|
||||
export class PipelineLayoutData {
|
||||
@@ -583,9 +587,13 @@ export class LayoutGraphDataVertex {
|
||||
this.t = id;
|
||||
this.j = object;
|
||||
}
|
||||
/** Out edge list */
|
||||
readonly o: OutE[] = [];
|
||||
/** In edge list */
|
||||
readonly i: OutE[] = [];
|
||||
/** Polymorphic object Id */
|
||||
readonly t: LayoutGraphDataValue;
|
||||
/** Polymorphic object */
|
||||
j: LayoutGraphDataObject;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
@@ -51,10 +51,10 @@ export class ClearValue {
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
}
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
declare x: number;
|
||||
declare y: number;
|
||||
declare z: number;
|
||||
declare w: number;
|
||||
}
|
||||
|
||||
export class RasterView {
|
||||
@@ -97,16 +97,16 @@ export class RasterView {
|
||||
this.slotID = 0;
|
||||
this.shaderStageFlags = shaderStageFlags;
|
||||
}
|
||||
slotName: string;
|
||||
declare slotName: string;
|
||||
slotName1 = '';
|
||||
accessType: AccessType;
|
||||
attachmentType: AttachmentType;
|
||||
loadOp: LoadOp;
|
||||
storeOp: StoreOp;
|
||||
clearFlags: ClearFlagBit;
|
||||
readonly clearColor: Color;
|
||||
declare accessType: AccessType;
|
||||
declare attachmentType: AttachmentType;
|
||||
declare loadOp: LoadOp;
|
||||
declare storeOp: StoreOp;
|
||||
declare clearFlags: ClearFlagBit;
|
||||
declare readonly clearColor: Color;
|
||||
slotID = 0;
|
||||
shaderStageFlags: ShaderStageFlagBit;
|
||||
declare shaderStageFlags: ShaderStageFlagBit;
|
||||
}
|
||||
|
||||
export class ComputeView {
|
||||
@@ -140,13 +140,13 @@ export class ComputeView {
|
||||
this.clearValue.reset(0, 0, 0, 0);
|
||||
this.shaderStageFlags = shaderStageFlags;
|
||||
}
|
||||
name: string;
|
||||
accessType: AccessType;
|
||||
declare name: string;
|
||||
declare accessType: AccessType;
|
||||
plane = 0;
|
||||
clearFlags: ClearFlagBit;
|
||||
clearValueType: ClearValueType;
|
||||
readonly clearValue: ClearValue;
|
||||
shaderStageFlags: ShaderStageFlagBit;
|
||||
declare clearFlags: ClearFlagBit;
|
||||
declare clearValueType: ClearValueType;
|
||||
declare readonly clearValue: ClearValue;
|
||||
declare shaderStageFlags: ShaderStageFlagBit;
|
||||
}
|
||||
|
||||
export class ResourceDesc {
|
||||
@@ -183,7 +183,7 @@ export class ResourceTraits {
|
||||
reset (residency: ResourceResidency): void {
|
||||
this.residency = residency;
|
||||
}
|
||||
residency: ResourceResidency;
|
||||
declare residency: ResourceResidency;
|
||||
}
|
||||
|
||||
export class RenderSwapchain {
|
||||
@@ -199,12 +199,12 @@ export class RenderSwapchain {
|
||||
this.generation = 0xFFFFFFFF;
|
||||
this.isDepthStencil = isDepthStencil;
|
||||
}
|
||||
/*pointer*/ swapchain: Swapchain | null;
|
||||
declare /*pointer*/ swapchain: Swapchain | null;
|
||||
/*pointer*/ renderWindow: RenderWindow | null = null;
|
||||
currentID = 0;
|
||||
numBackBuffers = 0;
|
||||
generation = 0xFFFFFFFF;
|
||||
isDepthStencil: boolean;
|
||||
declare isDepthStencil: boolean;
|
||||
}
|
||||
|
||||
export class ResourceStates {
|
||||
@@ -222,7 +222,7 @@ export class ManagedBuffer {
|
||||
this.buffer = buffer;
|
||||
this.fenceValue = 0;
|
||||
}
|
||||
/*refcount*/ buffer: Buffer | null;
|
||||
declare /*refcount*/ buffer: Buffer | null;
|
||||
fenceValue = 0;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ export class PersistentBuffer {
|
||||
this.buffer = buffer;
|
||||
this.fenceValue = 0;
|
||||
}
|
||||
/*refcount*/ buffer: Buffer | null;
|
||||
declare /*refcount*/ buffer: Buffer | null;
|
||||
fenceValue = 0;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ export class ManagedTexture {
|
||||
this.texture = texture;
|
||||
this.fenceValue = 0;
|
||||
}
|
||||
/*refcount*/ texture: Texture | null;
|
||||
declare /*refcount*/ texture: Texture | null;
|
||||
fenceValue = 0;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ export class PersistentTexture {
|
||||
this.texture = texture;
|
||||
this.fenceValue = 0;
|
||||
}
|
||||
/*refcount*/ texture: Texture | null;
|
||||
declare /*refcount*/ texture: Texture | null;
|
||||
fenceValue = 0;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,9 @@ export class Subpass {
|
||||
//=================================================================
|
||||
// Graph Concept
|
||||
export class SubpassGraphVertex {
|
||||
/** Out edge list */
|
||||
readonly o: OutE[] = [];
|
||||
/** In edge list */
|
||||
readonly i: OutE[] = [];
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
@@ -456,9 +458,9 @@ export class RasterSubpass {
|
||||
readonly computeViews: Map<string, ComputeView[]> = new Map<string, ComputeView[]>();
|
||||
readonly resolvePairs: ResolvePair[] = [];
|
||||
readonly viewport: Viewport = new Viewport();
|
||||
subpassID: number;
|
||||
count: number;
|
||||
quality: number;
|
||||
declare subpassID: number;
|
||||
declare count: number;
|
||||
declare quality: number;
|
||||
showStatistics = false;
|
||||
}
|
||||
|
||||
@@ -473,7 +475,7 @@ export class ComputeSubpass {
|
||||
}
|
||||
readonly rasterViews: Map<string, RasterView> = new Map<string, RasterView>();
|
||||
readonly computeViews: Map<string, ComputeView[]> = new Map<string, ComputeView[]>();
|
||||
subpassID: number;
|
||||
declare subpassID: number;
|
||||
}
|
||||
|
||||
export class RasterPass {
|
||||
@@ -521,8 +523,8 @@ export class PersistentRenderPassAndFramebuffer {
|
||||
this.clearDepth = 0;
|
||||
this.clearStencil = 0;
|
||||
}
|
||||
/*refcount*/ renderPass: RenderPass | null;
|
||||
/*refcount*/ framebuffer: Framebuffer | null;
|
||||
declare /*refcount*/ renderPass: RenderPass | null;
|
||||
declare /*refcount*/ framebuffer: Framebuffer | null;
|
||||
readonly clearColors: Color[] = [];
|
||||
clearDepth = 0;
|
||||
clearStencil = 0;
|
||||
@@ -631,9 +633,13 @@ export class ResourceGraphVertex {
|
||||
this.t = id;
|
||||
this.j = object;
|
||||
}
|
||||
/** Out edge list */
|
||||
readonly o: OutE[] = [];
|
||||
/** In edge list */
|
||||
readonly i: OutE[] = [];
|
||||
/** Polymorphic object Id */
|
||||
readonly t: ResourceGraphValue;
|
||||
/** Polymorphic object */
|
||||
j: ResourceGraphObject;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
@@ -992,9 +998,9 @@ export class ClearView {
|
||||
this.clearFlags = clearFlags;
|
||||
this.clearColor.reset();
|
||||
}
|
||||
slotName: string;
|
||||
clearFlags: ClearFlagBit;
|
||||
readonly clearColor: Color;
|
||||
declare slotName: string;
|
||||
declare clearFlags: ClearFlagBit;
|
||||
declare readonly clearColor: Color;
|
||||
}
|
||||
|
||||
export class RenderQueue {
|
||||
@@ -1009,9 +1015,9 @@ export class RenderQueue {
|
||||
this.passLayoutID = passLayoutID;
|
||||
this.viewport = null;
|
||||
}
|
||||
hint: QueueHint;
|
||||
phaseID: number;
|
||||
passLayoutID: number;
|
||||
declare hint: QueueHint;
|
||||
declare phaseID: number;
|
||||
declare passLayoutID: number;
|
||||
viewport: Viewport | null = null;
|
||||
}
|
||||
|
||||
@@ -1052,12 +1058,12 @@ export class SceneData {
|
||||
this.cullingFlags = cullingFlags;
|
||||
this.shadingLight = shadingLight;
|
||||
}
|
||||
/*pointer*/ scene: RenderScene | null;
|
||||
/*pointer*/ camera: Camera | null;
|
||||
readonly light: LightInfo;
|
||||
flags: SceneFlags;
|
||||
cullingFlags: CullingFlags;
|
||||
/*refcount*/ shadingLight: Light | null;
|
||||
declare /*pointer*/ scene: RenderScene | null;
|
||||
declare /*pointer*/ camera: Camera | null;
|
||||
declare readonly light: LightInfo;
|
||||
declare flags: SceneFlags;
|
||||
declare cullingFlags: CullingFlags;
|
||||
declare /*refcount*/ shadingLight: Light | null;
|
||||
}
|
||||
|
||||
export class Dispatch {
|
||||
@@ -1087,11 +1093,11 @@ export class Dispatch {
|
||||
this.threadGroupCountY = threadGroupCountY;
|
||||
this.threadGroupCountZ = threadGroupCountZ;
|
||||
}
|
||||
/*refcount*/ material: Material | null;
|
||||
passID: number;
|
||||
threadGroupCountX: number;
|
||||
threadGroupCountY: number;
|
||||
threadGroupCountZ: number;
|
||||
declare /*refcount*/ material: Material | null;
|
||||
declare passID: number;
|
||||
declare threadGroupCountX: number;
|
||||
declare threadGroupCountY: number;
|
||||
declare threadGroupCountZ: number;
|
||||
}
|
||||
|
||||
export class Blit {
|
||||
@@ -1107,10 +1113,10 @@ export class Blit {
|
||||
this.sceneFlags = sceneFlags;
|
||||
this.camera = camera;
|
||||
}
|
||||
/*refcount*/ material: Material | null;
|
||||
passID: number;
|
||||
sceneFlags: SceneFlags;
|
||||
/*pointer*/ camera: Camera | null;
|
||||
declare /*refcount*/ material: Material | null;
|
||||
declare passID: number;
|
||||
declare sceneFlags: SceneFlags;
|
||||
declare /*pointer*/ camera: Camera | null;
|
||||
}
|
||||
|
||||
export class RenderData {
|
||||
@@ -1228,11 +1234,17 @@ export class RenderGraphVertex {
|
||||
this.t = id;
|
||||
this.j = object;
|
||||
}
|
||||
/** Out edge list */
|
||||
readonly o: OutE[] = [];
|
||||
/** In edge list */
|
||||
readonly i: OutE[] = [];
|
||||
/** Child edge list */
|
||||
readonly c: OutE[] = [];
|
||||
/** Parent edge list */
|
||||
readonly p: OutE[] = [];
|
||||
/** Polymorphic object Id */
|
||||
readonly t: RenderGraphValue;
|
||||
/** Polymorphic object */
|
||||
j: RenderGraphObject;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
@@ -157,10 +157,10 @@ export class LightInfo {
|
||||
this.level = level;
|
||||
this.culledByLight = culledByLight;
|
||||
}
|
||||
/*refcount*/ light: Light | null;
|
||||
/*pointer*/ probe: ReflectionProbe | null;
|
||||
level: number;
|
||||
culledByLight: boolean;
|
||||
declare /*refcount*/ light: Light | null;
|
||||
declare /*pointer*/ probe: ReflectionProbe | null;
|
||||
declare level: number;
|
||||
declare culledByLight: boolean;
|
||||
}
|
||||
|
||||
export const enum DescriptorTypeOrder {
|
||||
@@ -183,7 +183,7 @@ export class Descriptor {
|
||||
this.type = type;
|
||||
this.count = 1;
|
||||
}
|
||||
type: Type;
|
||||
declare type: Type;
|
||||
count = 1;
|
||||
}
|
||||
|
||||
@@ -224,10 +224,10 @@ export class DescriptorBlockIndex {
|
||||
this.descriptorType = descriptorType;
|
||||
this.visibility = visibility;
|
||||
}
|
||||
updateFrequency: UpdateFrequency;
|
||||
parameterType: ParameterType;
|
||||
descriptorType: DescriptorTypeOrder;
|
||||
visibility: ShaderStageFlagBit;
|
||||
declare updateFrequency: UpdateFrequency;
|
||||
declare parameterType: ParameterType;
|
||||
declare descriptorType: DescriptorTypeOrder;
|
||||
declare visibility: ShaderStageFlagBit;
|
||||
}
|
||||
|
||||
export const enum ResolveFlags {
|
||||
@@ -264,11 +264,11 @@ export class ResolvePair {
|
||||
this.mode = mode;
|
||||
this.mode1 = mode1;
|
||||
}
|
||||
source: string;
|
||||
target: string;
|
||||
resolveFlags: ResolveFlags;
|
||||
mode: ResolveMode;
|
||||
mode1: ResolveMode;
|
||||
declare source: string;
|
||||
declare target: string;
|
||||
declare resolveFlags: ResolveFlags;
|
||||
declare mode: ResolveMode;
|
||||
declare mode1: ResolveMode;
|
||||
}
|
||||
|
||||
export class CopyPair {
|
||||
@@ -318,16 +318,16 @@ export class CopyPair {
|
||||
this.targetFirstSlice = targetFirstSlice;
|
||||
this.targetPlaneSlice = targetPlaneSlice;
|
||||
}
|
||||
source: string;
|
||||
target: string;
|
||||
mipLevels: number;
|
||||
numSlices: number;
|
||||
sourceMostDetailedMip: number;
|
||||
sourceFirstSlice: number;
|
||||
sourcePlaneSlice: number;
|
||||
targetMostDetailedMip: number;
|
||||
targetFirstSlice: number;
|
||||
targetPlaneSlice: number;
|
||||
declare source: string;
|
||||
declare target: string;
|
||||
declare mipLevels: number;
|
||||
declare numSlices: number;
|
||||
declare sourceMostDetailedMip: number;
|
||||
declare sourceFirstSlice: number;
|
||||
declare sourcePlaneSlice: number;
|
||||
declare targetMostDetailedMip: number;
|
||||
declare targetFirstSlice: number;
|
||||
declare targetPlaneSlice: number;
|
||||
}
|
||||
|
||||
export class UploadPair {
|
||||
@@ -364,13 +364,13 @@ export class UploadPair {
|
||||
this.targetFirstSlice = targetFirstSlice;
|
||||
this.targetPlaneSlice = targetPlaneSlice;
|
||||
}
|
||||
readonly source: Uint8Array;
|
||||
target: string;
|
||||
mipLevels: number;
|
||||
numSlices: number;
|
||||
targetMostDetailedMip: number;
|
||||
targetFirstSlice: number;
|
||||
targetPlaneSlice: number;
|
||||
declare readonly source: Uint8Array;
|
||||
declare target: string;
|
||||
declare mipLevels: number;
|
||||
declare numSlices: number;
|
||||
declare targetMostDetailedMip: number;
|
||||
declare targetFirstSlice: number;
|
||||
declare targetPlaneSlice: number;
|
||||
}
|
||||
|
||||
export class MovePair {
|
||||
@@ -408,13 +408,13 @@ export class MovePair {
|
||||
this.targetFirstSlice = targetFirstSlice;
|
||||
this.targetPlaneSlice = targetPlaneSlice;
|
||||
}
|
||||
source: string;
|
||||
target: string;
|
||||
mipLevels: number;
|
||||
numSlices: number;
|
||||
targetMostDetailedMip: number;
|
||||
targetFirstSlice: number;
|
||||
targetPlaneSlice: number;
|
||||
declare source: string;
|
||||
declare target: string;
|
||||
declare mipLevels: number;
|
||||
declare numSlices: number;
|
||||
declare targetMostDetailedMip: number;
|
||||
declare targetFirstSlice: number;
|
||||
declare targetPlaneSlice: number;
|
||||
}
|
||||
|
||||
export class PipelineStatistics {
|
||||
|
||||
@@ -46,11 +46,11 @@ export class ProgramInfo {
|
||||
this.blockSizes = blockSizes;
|
||||
this.handleMap = handleMap;
|
||||
}
|
||||
readonly programInfo: IProgramInfo;
|
||||
readonly shaderInfo: ShaderInfo;
|
||||
readonly attributes: Attribute[];
|
||||
readonly blockSizes: number[];
|
||||
readonly handleMap: Record<string, number>;
|
||||
declare readonly programInfo: IProgramInfo;
|
||||
declare readonly shaderInfo: ShaderInfo;
|
||||
declare readonly attributes: Attribute[];
|
||||
declare readonly blockSizes: number[];
|
||||
declare readonly handleMap: Record<string, number>;
|
||||
}
|
||||
|
||||
export class ProgramGroup {
|
||||
|
||||
Reference in New Issue
Block a user