Skip to content

Commit 0ee2984

Browse files
Chau TranChau Tran
Chau Tran
authored and
Chau Tran
committed
fix(soba): relax typings (need revisit)
1 parent d9f4db1 commit 0ee2984

File tree

13 files changed

+73
-70
lines changed

13 files changed

+73
-70
lines changed

libs/soba/abstractions/src/catmull-rom-line/catmull-rom-line.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ declare module '../line/line-input' {
2121
<ngts-line
2222
[lineRef]="lineRef"
2323
[points]="segmentedPoints()"
24-
[vertexColors]="interpolatedVertexColors()"
24+
[vertexColors]="interpolatedVertexColors()!"
2525
[color]="lineParameters().color"
26-
[resolution]="lineParameters().resolution"
27-
[lineWidth]="lineParameters().linewidth"
28-
[alphaToCoverage]="lineParameters().alphaToCoverage"
29-
[dashed]="lineParameters().dashed"
30-
[dashScale]="lineParameters().dashScale"
31-
[dashSize]="lineParameters().dashSize"
32-
[dashOffset]="lineParameters().dashOffset"
33-
[gapSize]="lineParameters().gapSize"
34-
[wireframe]="lineParameters().wireframe"
35-
[worldUnits]="lineParameters().worldUnits"
26+
[resolution]="lineParameters().resolution!"
27+
[lineWidth]="lineParameters().linewidth!"
28+
[alphaToCoverage]="lineParameters().alphaToCoverage!"
29+
[dashed]="lineParameters().dashed!"
30+
[dashScale]="lineParameters().dashScale!"
31+
[dashSize]="lineParameters().dashSize!"
32+
[dashOffset]="lineParameters().dashOffset!"
33+
[gapSize]="lineParameters().gapSize!"
34+
[wireframe]="lineParameters().wireframe!"
35+
[worldUnits]="lineParameters().worldUnits!"
3636
/>
3737
`,
3838
imports: [NgtsLine],

libs/soba/abstractions/src/cubic-bezier-line/cubic-bezier-line.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ declare module '../line/line-input' {
2121
<ngts-line
2222
[lineRef]="lineRef"
2323
[points]="points()"
24-
[color]="lineParameters().color"
25-
[vertexColors]="lineParameters().vertexColors"
26-
[resolution]="lineParameters().resolution"
27-
[lineWidth]="lineParameters().linewidth"
28-
[alphaToCoverage]="lineParameters().alphaToCoverage"
29-
[dashed]="lineParameters().dashed"
30-
[dashScale]="lineParameters().dashScale"
31-
[dashSize]="lineParameters().dashSize"
32-
[dashOffset]="lineParameters().dashOffset"
33-
[gapSize]="lineParameters().gapSize"
34-
[wireframe]="lineParameters().wireframe"
35-
[worldUnits]="lineParameters().worldUnits"
24+
[color]="lineParameters().color!"
25+
[vertexColors]="lineParameters().vertexColors!"
26+
[resolution]="lineParameters().resolution!"
27+
[lineWidth]="lineParameters().linewidth!"
28+
[alphaToCoverage]="lineParameters().alphaToCoverage!"
29+
[dashed]="lineParameters().dashed!"
30+
[dashScale]="lineParameters().dashScale!"
31+
[dashSize]="lineParameters().dashSize!"
32+
[dashOffset]="lineParameters().dashOffset!"
33+
[gapSize]="lineParameters().gapSize!"
34+
[wireframe]="lineParameters().wireframe!"
35+
[worldUnits]="lineParameters().worldUnits!"
3636
/>
3737
`,
3838
imports: [NgtsLine],

libs/soba/abstractions/src/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ export class NgtsGizmoViewcubeFaceMaterial extends NgtSignalStore<{
8787
selector: 'ngts-gizmo-viewcube-face-cube',
8888
standalone: true,
8989
template: `
90-
<ngt-mesh (pointermove)="onPointerMove($event)" (pointerout)="onPointerOut($event)" (click)="onClick($event)">
90+
<ngt-mesh
91+
(pointermove)="onPointerMove($any($event))"
92+
(pointerout)="onPointerOut($any($event))"
93+
(click)="onClick($any($event))"
94+
>
9195
<ngt-box-geometry />
9296
<ngts-gizmo-viewcube-face-material *ngFor="let i; repeat: 6" [hover]="hover() === i" [index]="i" />
9397
</ngt-mesh>

libs/soba/abstractions/src/gizmo-helper/gizmo-viewport/gizmo-viewport.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extend({ Group, AmbientLight, PointLight });
3737
[labelColor]="viewportLabelColor()"
3838
[clickEmitter]="clicked"
3939
[axisHeadScale]="viewportAxisHeadScale()"
40-
(pointerdown)="onPointerDown($event)"
40+
(pointerdown)="onPointerDown($any($event))"
4141
></ngts-gizmo-viewport-axis-head>
4242
<ngts-gizmo-viewport-axis-head
4343
[arcStyle]="viewportAxisColors()[1]"
@@ -48,7 +48,7 @@ extend({ Group, AmbientLight, PointLight });
4848
[labelColor]="viewportLabelColor()"
4949
[clickEmitter]="clicked"
5050
[axisHeadScale]="viewportAxisHeadScale()"
51-
(pointerdown)="onPointerDown($event)"
51+
(pointerdown)="onPointerDown($any($event))"
5252
></ngts-gizmo-viewport-axis-head>
5353
<ngts-gizmo-viewport-axis-head
5454
[arcStyle]="viewportAxisColors()[2]"
@@ -59,7 +59,7 @@ extend({ Group, AmbientLight, PointLight });
5959
[labelColor]="viewportLabelColor()"
6060
[clickEmitter]="clicked"
6161
[axisHeadScale]="viewportAxisHeadScale()"
62-
(pointerdown)="onPointerDown($event)"
62+
(pointerdown)="onPointerDown($any($event))"
6363
></ngts-gizmo-viewport-axis-head>
6464
<ng-container *ngIf="!viewportHideNegativeAxes()">
6565
<ngts-gizmo-viewport-axis-head
@@ -70,7 +70,7 @@ extend({ Group, AmbientLight, PointLight });
7070
[labelColor]="viewportLabelColor()"
7171
[clickEmitter]="clicked"
7272
[axisHeadScale]="viewportAxisHeadScale()"
73-
(pointerdown)="onPointerDown($event)"
73+
(pointerdown)="onPointerDown($any($event))"
7474
></ngts-gizmo-viewport-axis-head>
7575
<ngts-gizmo-viewport-axis-head
7676
[arcStyle]="viewportAxisColors()[1]"
@@ -80,7 +80,7 @@ extend({ Group, AmbientLight, PointLight });
8080
[labelColor]="viewportLabelColor()"
8181
[clickEmitter]="clicked"
8282
[axisHeadScale]="viewportAxisHeadScale()"
83-
(pointerdown)="onPointerDown($event)"
83+
(pointerdown)="onPointerDown($any($event))"
8484
></ngts-gizmo-viewport-axis-head>
8585
<ngts-gizmo-viewport-axis-head
8686
[arcStyle]="viewportAxisColors()[2]"
@@ -90,7 +90,7 @@ extend({ Group, AmbientLight, PointLight });
9090
[labelColor]="viewportLabelColor()"
9191
[clickEmitter]="clicked"
9292
[axisHeadScale]="viewportAxisHeadScale()"
93-
(pointerdown)="onPointerDown($event)"
93+
(pointerdown)="onPointerDown($any($event))"
9494
></ngts-gizmo-viewport-axis-head>
9595
</ng-container>
9696
</ng-container>

libs/soba/abstractions/src/quadratic-bezier-line/quadratic-bezier-line.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ const v = new THREE.Vector3();
2222
<ngts-line
2323
[lineRef]="lineRef"
2424
[points]="points()"
25-
[color]="lineParameters().color"
26-
[vertexColors]="lineParameters().vertexColors"
27-
[resolution]="lineParameters().resolution"
28-
[lineWidth]="lineParameters().linewidth"
29-
[alphaToCoverage]="lineParameters().alphaToCoverage"
30-
[dashed]="lineParameters().dashed"
31-
[dashScale]="lineParameters().dashScale"
32-
[dashSize]="lineParameters().dashSize"
33-
[dashOffset]="lineParameters().dashOffset"
34-
[gapSize]="lineParameters().gapSize"
35-
[wireframe]="lineParameters().wireframe"
36-
[worldUnits]="lineParameters().worldUnits"
25+
[color]="lineParameters().color!"
26+
[vertexColors]="lineParameters().vertexColors!"
27+
[resolution]="lineParameters().resolution!"
28+
[lineWidth]="lineParameters().linewidth!"
29+
[alphaToCoverage]="lineParameters().alphaToCoverage!"
30+
[dashed]="lineParameters().dashed!"
31+
[dashScale]="lineParameters().dashScale!"
32+
[dashSize]="lineParameters().dashSize!"
33+
[dashOffset]="lineParameters().dashOffset!"
34+
[gapSize]="lineParameters().gapSize!"
35+
[wireframe]="lineParameters().wireframe!"
36+
[worldUnits]="lineParameters().worldUnits!"
3737
/>
3838
`,
3939
imports: [NgtsLine],

libs/soba/abstractions/src/text-3d/text-3d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ export class NgtsText3D extends NgtSignalStore<NgtsText3DState> {
161161
letterSpacing: this.#letterSpacing(),
162162
lineHeight: this.#lineHeight(),
163163
},
164-
] as const;
164+
];
165165
});
166166
}

libs/soba/loaders/src/gltf-loader/gltf-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ injectNgtsGLTFLoader['preload'] = <TUrl extends string | string[] | Record<strin
6464
extensions?: (loader: GLTFLoader) => void;
6565
} = {}
6666
) => {
67-
injectNgtLoader.preload(() => GLTFLoader, path, _extensions(useDraco, useMeshOpt, extensions));
67+
(injectNgtLoader as any)['preload'](() => GLTFLoader, path, _extensions(useDraco, useMeshOpt, extensions));
6868
};

libs/soba/loaders/src/texture-loader/texture-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ export function injectNgtsTextureLoader<TInput extends string[] | string | Recor
3636
injectNgtsTextureLoader['preload'] = <TInput extends string[] | string | Record<string, string>>(
3737
input: () => TInput
3838
) => {
39-
injectNgtLoader.preload(() => THREE.TextureLoader, input);
39+
(injectNgtLoader as any).preload(() => THREE.TextureLoader, input);
4040
};

libs/soba/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,5 @@
4242
},
4343
"sideEffects": false,
4444
"generators": "./plugin/generators.json",
45-
"schematics": "./plugin/generators.json",
46-
"web-types": "./web-types.json"
45+
"schematics": "./plugin/generators.json"
4746
}

libs/soba/staging/src/cloud/cloud.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { injectNgtsTextureLoader } from 'angular-three-soba/loaders';
1313
import { Group, Mesh, MeshStandardMaterial, PlaneGeometry } from 'three';
1414

1515
const CLOUD_URL = 'https://rawcdn.githack.com/pmndrs/drei-assets/9225a9f1fbd449d9411125c2f419b843d0308c9f/cloud.png';
16-
injectNgtsTextureLoader.preload(() => CLOUD_URL);
16+
(injectNgtsTextureLoader as any).preload(() => CLOUD_URL);
1717

1818
extend({ Group, Mesh, PlaneGeometry, MeshStandardMaterial });
1919

libs/soba/staging/src/environment/environment-ground.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extend({ GroundProjectedEnv });
1111
selector: 'ngts-environment-ground',
1212
standalone: true,
1313
template: `
14-
<ngts-environment-map [map]="texture()" [background]="environmentInput.environmentBackground()" />
14+
<ngts-environment-map [map]="texture()" [background]="!!environmentInput.environmentBackground()" />
1515
<ngt-ground-projected-env *args="groundArgs()" [scale]="scale()" [height]="height()" [radius]="radius()" />
1616
`,
1717
imports: [NgtsEnvironmentMap, NgtArgs],

libs/soba/staging/src/environment/environment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ export class NgtsEnvironmentContent {}
1818
<ngts-environment-map
1919
*ngIf="environmentMap(); else noMap"
2020
[map]="environmentMap()"
21-
[background]="environmentBackground()"
21+
[background]="!!environmentBackground()"
2222
/>
2323
<ng-template #noMap>
2424
<ngts-environment-portal *ngIf="content; else noPortal">
2525
<ng-container *ngTemplateOutlet="content" />
2626
</ngts-environment-portal>
2727
<ng-template #noPortal>
28-
<ngts-environment-cube [background]="environmentBackground()" />
28+
<ngts-environment-cube [background]="!!environmentBackground()" />
2929
</ng-template>
3030
</ng-template>
3131
</ng-template>

libs/soba/staging/src/stage/stage.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ extend({ AmbientLight, SpotLight, Vector2, PointLight, Group });
9595
selector: 'ngts-stage',
9696
standalone: true,
9797
template: `
98-
<ngt-ambient-light [intensity]="stageIntensity() / 3" />
98+
<ngt-ambient-light [intensity]="stageIntensity()! / 3" />
9999
<ngt-spot-light
100100
[penumbra]="1"
101101
[position]="spotLightPosition()"
102-
[intensity]="stageIntensity() * 2"
102+
[intensity]="stageIntensity()! * 2"
103103
[castShadow]="!!stageShadows()"
104104
>
105105
<ngt-value [rawValue]="shadowsInfo().shadowBias" attach="shadow.bias" />
@@ -175,21 +175,21 @@ extend({ AmbientLight, SpotLight, Vector2, PointLight, Group });
175175
</ngts-accumulative-shadows>
176176
</ngt-group>
177177
<ngts-environment
178-
*ngIf="environmentInfo()"
179-
[frames]="environmentInfo().frames"
180-
[near]="environmentInfo().near"
181-
[far]="environmentInfo().far"
182-
[resolution]="environmentInfo().resolution"
183-
[background]="environmentInfo().background"
184-
[blur]="environmentInfo().blur"
185-
[map]="environmentInfo().map"
186-
[files]="environmentInfo().files"
187-
[path]="environmentInfo().path"
188-
[preset]="environmentInfo().preset"
189-
[scene]="environmentInfo().scene"
190-
[extensions]="environmentInfo().extensions"
191-
[ground]="environmentInfo().ground"
192-
[encoding]="environmentInfo().encoding"
178+
*ngIf="environmentInfo() as environmentInfo"
179+
[frames]="environmentInfo.frames!"
180+
[near]="environmentInfo.near!"
181+
[far]="environmentInfo.far!"
182+
[resolution]="environmentInfo.resolution!"
183+
[background]="environmentInfo.background!"
184+
[blur]="environmentInfo.blur!"
185+
[map]="environmentInfo.map!"
186+
[files]="environmentInfo.files!"
187+
[path]="environmentInfo.path!"
188+
[preset]="environmentInfo.preset!"
189+
[scene]="environmentInfo.scene!"
190+
[extensions]="environmentInfo.extensions!"
191+
[ground]="environmentInfo.ground!"
192+
[encoding]="environmentInfo.encoding!"
193193
/>
194194
`,
195195
imports: [
@@ -250,7 +250,7 @@ export class NgtsStage extends NgtSignalStore<NgtsStageProps> {
250250
return typeof preset === 'string' ? presets[preset] : preset;
251251
});
252252

253-
readonly shadowsInfo = computed(() => {
253+
readonly shadowsInfo = computed<any>(() => {
254254
const shadows = this.stageShadows();
255255
const restProps = typeof shadows === 'string' ? {} : (shadows as NgtsStageShadows) || {};
256256
return {
@@ -264,7 +264,7 @@ export class NgtsStage extends NgtSignalStore<NgtsStageProps> {
264264
};
265265
});
266266

267-
readonly spotLightPosition = computed(() => {
267+
readonly spotLightPosition = computed<[number, number, number]>(() => {
268268
const config = this.config();
269269
if (!config) return [0, 0, 0];
270270
const radius = this.boundingState().radius;

0 commit comments

Comments
 (0)