summaryrefslogtreecommitdiff
path: root/packages/frontend/src/utility/snowfall-effect.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2026-01-09 22:06:40 +0900
committerGitHub <noreply@github.com>2026-01-09 22:06:40 +0900
commit41592eafb363e3c62ab2d3e5f41b38d7d083d3fb (patch)
tree8f69243a5482ad4161eb28b69769684a221aa05c /packages/frontend/src/utility/snowfall-effect.ts
parentfix(frontend): popupのemit型が正しく利用できるように修正 (#16... (diff)
downloadmisskey-41592eafb363e3c62ab2d3e5f41b38d7d083d3fb.tar.gz
misskey-41592eafb363e3c62ab2d3e5f41b38d7d083d3fb.tar.bz2
misskey-41592eafb363e3c62ab2d3e5f41b38d7d083d3fb.zip
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
Diffstat (limited to 'packages/frontend/src/utility/snowfall-effect.ts')
-rw-r--r--packages/frontend/src/utility/snowfall-effect.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/packages/frontend/src/utility/snowfall-effect.ts b/packages/frontend/src/utility/snowfall-effect.ts
index cefa720ebf..aa86db6bd1 100644
--- a/packages/frontend/src/utility/snowfall-effect.ts
+++ b/packages/frontend/src/utility/snowfall-effect.ts
@@ -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);
}
}