mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-21 14:35:29 +02:00
refactor: make noImplicitAny true (#17083)
* wip * Update emojis.emoji.vue * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update manager.ts * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update analytics.ts
This commit is contained in:
@@ -21,7 +21,7 @@ export class SnowfallEffect {
|
||||
}>;
|
||||
private uniforms: Record<string, {
|
||||
type: string;
|
||||
value: number[] | Float32Array;
|
||||
value: number | number[] | Float32Array;
|
||||
location: WebGLUniformLocation;
|
||||
}>;
|
||||
private texture: WebGLTexture;
|
||||
@@ -44,9 +44,9 @@ export class SnowfallEffect {
|
||||
start: number;
|
||||
previous: number;
|
||||
} = {
|
||||
start: 0,
|
||||
previous: 0,
|
||||
};
|
||||
start: 0,
|
||||
previous: 0,
|
||||
};
|
||||
private raf = 0;
|
||||
|
||||
private density: number = 1 / 90;
|
||||
@@ -90,7 +90,7 @@ export class SnowfallEffect {
|
||||
mat2: 'uniformMatrix2fv',
|
||||
mat3: 'uniformMatrix3fv',
|
||||
mat4: 'uniformMatrix4fv',
|
||||
};
|
||||
} as const;
|
||||
|
||||
private CAMERA = {
|
||||
fov: 60,
|
||||
@@ -167,7 +167,7 @@ export class SnowfallEffect {
|
||||
return { ...this.WIND };
|
||||
}
|
||||
|
||||
private initShader(type, source): WebGLShader {
|
||||
private initShader(type: number, source: string): WebGLShader {
|
||||
const { gl } = this;
|
||||
const shader = gl.createShader(type);
|
||||
if (shader == null) throw new Error('Failed to create shader');
|
||||
@@ -224,7 +224,7 @@ export class SnowfallEffect {
|
||||
}
|
||||
}
|
||||
|
||||
private setBuffer(name: string, value?) {
|
||||
private setBuffer(name: string, value?: number[] | undefined) {
|
||||
const { gl, buffers } = this;
|
||||
const buffer = buffers[name];
|
||||
|
||||
@@ -253,18 +253,18 @@ export class SnowfallEffect {
|
||||
}
|
||||
}
|
||||
|
||||
private setUniform(name: string, value?) {
|
||||
private setUniform(name: string, value?: number | number[] | Float32Array<ArrayBufferLike> | undefined) {
|
||||
const { gl, uniforms } = this;
|
||||
const uniform = uniforms[name];
|
||||
const setter = this.UNIFORM_SETTERS[uniform.type];
|
||||
const setter = this.UNIFORM_SETTERS[uniform.type as keyof typeof this.UNIFORM_SETTERS];
|
||||
const isMatrix = /^mat[2-4]$/i.test(uniform.type);
|
||||
|
||||
uniform.value = value ?? uniform.value;
|
||||
|
||||
if (isMatrix) {
|
||||
gl[setter](uniform.location, false, uniform.value);
|
||||
(gl as any)[setter](uniform.location, false, uniform.value);
|
||||
} else {
|
||||
gl[setter](uniform.location, uniform.value);
|
||||
(gl as any)[setter](uniform.location, uniform.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user