Skip to content

Commit 462f716

Browse files
author
Aleksander Katan
committed
Update resolutionCtx type
1 parent 05ff560 commit 462f716

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

packages/typegpu/src/resolutionCtx.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -602,19 +602,7 @@ export class ResolutionCtxImpl implements ResolutionCtx {
602602
}
603603
}
604604

605-
/**
606-
* Temporarily renames the item.
607-
* Useful for resolutions with slots,
608-
* since functions with different slots should have different names,
609-
* and all hold the same inner function that is being resolved multiple times.
610-
* @param item the item to rename
611-
* @param name the temporary name to assign to the item (if missing, just returns `callback()`)
612-
*/
613-
withRenamed<T>(
614-
item: object,
615-
name: string | undefined,
616-
callback: () => T,
617-
): T {
605+
withRenamed<T>(item: object, name: string | undefined, callback: () => T): T {
618606
if (!name) {
619607
return callback();
620608
}

packages/typegpu/src/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,16 @@ export interface ResolutionCtx {
304304

305305
get varyingLocations(): Record<string, number> | undefined;
306306

307+
/**
308+
* Temporarily renames the item.
309+
* Useful for resolutions with slots,
310+
* since functions with different slots should have different names,
311+
* and all hold the same inner function that is being resolved multiple times.
312+
* @param item the item to rename
313+
* @param name the temporary name to assign to the item (if missing, just returns `callback()`)
314+
*/
315+
withRenamed<T>(item: object, name: string | undefined, callback: () => T): T;
316+
307317
getUniqueName(resource: object): string;
308318
makeNameValid(name: string): string;
309319
}

0 commit comments

Comments
 (0)