Skip to content

Commit d90e3a2

Browse files
committed
Add type for loadFont callback
1 parent f1afc0d commit d90e3a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utils/patch.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export function applyPatches() {
9999
/createFileInput\(callback: Function, multiple\?: boolean\): ([pP]5)\.Element;/g,
100100
'createFileInput(callback: (input: $1.File) => any, multiple?: boolean): $1.Element;',
101101
);
102+
replace(
103+
['p5.d.ts', 'global.d.ts'],
104+
/loadFont\((.+), successCallback\?: Function, (.+)\): Promise\<([pP]5)\.Font\>;/g,
105+
'loadFont($1, successCallback: (font: $3.Font) => any, $2): Promise<$3.Font>;'
106+
);
102107

103108
// Type returned objects
104109
replace(

0 commit comments

Comments
 (0)