O
OneJS3y ago
Singtaa

And then in the .d.ts file, you can declare math as a module instead of a class. ```ts declare modu

And then in the .d.ts file, you can declare math as a module instead of a class.
declare module "math" {
type float2 = import("Unity/Mathematics").float2
type float3 = import("Unity/Mathematics").float3
type float4 = import("Unity/Mathematics").float4

export const PI

export function float2(x: number): float2
export function float2(x: number, y: number): float2
export function float3(x: number): float3
export function float3(x: number, y: number, z: number): float3
export function float4(x: number): float4
export function float4(x: number, y: number, z: number, w: number): float4

export function clamp(v: float, a: float, b: float): float
...
}
declare module "math" {
type float2 = import("Unity/Mathematics").float2
type float3 = import("Unity/Mathematics").float3
type float4 = import("Unity/Mathematics").float4

export const PI

export function float2(x: number): float2
export function float2(x: number, y: number): float2
export function float3(x: number): float3
export function float3(x: number, y: number, z: number): float3
export function float4(x: number): float4
export function float4(x: number, y: number, z: number, w: number): float4

export function clamp(v: float, a: float, b: float): float
...
}
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?