Skip to content

Commit d70cbba

Browse files
committed
Update accessor.ts
1 parent 013426a commit d70cbba

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/typegpu/src/core/slot/accessor.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ import type {
3333
// ----------
3434
// Public API
3535
// ----------
36-
3736
export function accessor<T extends AnyData | ((count: number) => AnyData)>(
3837
schemaOrConstructor: T,
39-
defaultValue?: TgpuAccessor.In<NoInfer<T>>,
38+
defaultValue?: TgpuAccessor.In<NoInfer<T>> | undefined,
4039
): TgpuAccessor<UnwrapRuntimeConstructor<T>> {
4140
return new TgpuAccessorImpl(
4241
schemaOrConstructor,
@@ -48,11 +47,11 @@ export function mutableAccessor<
4847
T extends AnyData | ((count: number) => AnyData),
4948
>(
5049
schemaOrConstructor: T,
51-
defaultValue?: TgpuMutableAccessor.In<UnwrapRuntimeConstructor<NoInfer<T>>>,
50+
defaultValue?: TgpuMutableAccessor.In<NoInfer<T>> | undefined,
5251
): TgpuMutableAccessor<UnwrapRuntimeConstructor<T>> {
5352
return new TgpuMutableAccessorImpl(
5453
schemaOrConstructor,
55-
defaultValue,
54+
defaultValue as TgpuMutableAccessor.In<AnyData>,
5655
) as unknown as TgpuMutableAccessor<UnwrapRuntimeConstructor<T>>;
5756
}
5857

0 commit comments

Comments
 (0)