Skip to content

Commit

Permalink
fix #31
Browse files Browse the repository at this point in the history
  • Loading branch information
asukaminato0721 committed Jun 8, 2023
1 parent 29989d2 commit 28f5200
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions patches/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,64 @@ replace(
uvs: number[]
}) => {});`
)

// https://github.com/p5-types/p5.ts/issues/31
replace(
"types/p5/src/math/random.d.ts",
"random(choices: any[]): any;",
"random<T>(choices: T[]): T;"
)

replace(
"types/p5/src/utilities/array_functions.d.ts",
"append(array: any[], value: any): any[];",
"append<T>(array: T[], value: T): T[];"
)
replace("types/p5/global.d.ts",
"append(array: any[], value: any): any[];",
"append<T>(array: T[], value: T): T[];"
)
replace(
"types/p5/src/image/image.d.ts",
`saveFrames(
filename: string,
extension: string,
duration: number,
framerate: number,
callback?: (p1: any[]) => any
): void;`,
`type Frame = {
imageData: string;
filename: string;
ext: string;
};
interface p5InstanceExtensions {
saveFrames: (filename: string, extension: string, duration: number, framerate: number, callback?: (frames: Frame[]) => void) => void;
}`
)
replace(
"types/p5/global.d.ts",
`saveFrames(
filename: string,
extension: string,
duration: number,
framerate: number,
callback?: (p1: any[]) => any
): void;`,
`type Frame = {
imageData: string;
filename: string;
ext: string;
};
interface p5InstanceExtensions {
saveFrames: (filename: string, extension: string, duration: number, framerate: number, callback?: (frames: Frame[]) => void) => void;
}`
)

replace(
"types/p5/src/core/p5.Element.d.ts",
"elt: any;",
"elt: HTMLElement;"
)

0 comments on commit 28f5200

Please sign in to comment.