Skip to content

Commit 026763a

Browse files
fix: Better type exports
1 parent 7e3fa3a commit 026763a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gpu.js",
3-
"version": "2.11.0",
3+
"version": "2.11.1",
44
"description": "GPU Accelerated JavaScript",
55
"engines": {
66
"node": ">=8.0.0"

src/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class GPU {
1313
nativeFunctions: IGPUNativeFunction[];
1414
setFunctions(flag: any): this;
1515
setNativeFunctions(flag: IGPUNativeFunction[]): this;
16-
addFunction(kernel: GPUFunction, settings?: IGPUFunctionSettings): this;
16+
addFunction<ArgTypes extends ThreadKernelVariable[] = ThreadKernelVariable[], ConstantsType = {}>(kernel: GPUFunction<ArgTypes, ConstantsType>, settings?: IGPUFunctionSettings): this;
1717
addNativeFunction(name: string, source: string, settings?: IGPUFunctionSettings): this;
1818
combineKernels(...kernels: KernelFunction[]): IKernelRunShortcut;
1919
combineKernels<KF extends KernelFunction>(...kernels: KF[]):
@@ -617,7 +617,7 @@ export class Input {
617617

618618
export type input = (value: number[], size: OutputDimensions) => Input;
619619

620-
export function alias(name: string, source: KernelFunction): KernelFunction;
620+
export function alias<T>(name: string, source: T): T;
621621

622622
export class KernelValue {
623623
constructor(value: KernelVariable, settings: IKernelValueSettings);
@@ -657,8 +657,8 @@ export interface IJSONSettings {
657657
threadDim?: number[];
658658
}
659659

660-
export type utils = {
661-
getMinifySafeName(arrowReference: () => Function): string;
660+
export declare const utils: {
661+
getMinifySafeName: <T>(arrowReference: () => T) => string
662662
}
663663

664664
export interface IReason {

0 commit comments

Comments
 (0)