Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions TS.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,7 @@ module Emit =
let m = i.Methods.Value.Methods.[0]
let overload = (GetOverloads (Function.Method m) false).[0]
let paramsString = ParamsToString overload.ParamCombinations
let returnType = DomTypeToTsType m.Type
Pt.Printl "type %s = (%s) => %s | { %s(%s): %s; };" i.Name paramsString returnType m.Name.Value paramsString returnType
Pt.Printl "type %s = ((%s) => any) | { %s(%s): any; };" i.Name paramsString m.Name.Value paramsString
Pt.Printl ""

let EmitCallBackFunctions flavor =
Expand Down
9 changes: 5 additions & 4 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1169,13 +1169,13 @@ interface WheelEventInit extends MouseEventInit {
deltaZ?: number;
}

type EventListener = (evt: Event) => void | { handleEvent(evt: Event): void; };
type EventListener = ((evt: Event) => any) | { handleEvent(evt: Event): any; };

type WebKitEntriesCallback = (entries: WebKitEntry[]) => void | { handleEvent(entries: WebKitEntry[]): void; };
type WebKitEntriesCallback = ((entries: WebKitEntry[]) => any) | { handleEvent(entries: WebKitEntry[]): any; };

type WebKitErrorCallback = (err: DOMError) => void | { handleEvent(err: DOMError): void; };
type WebKitErrorCallback = ((err: DOMError) => any) | { handleEvent(err: DOMError): any; };

type WebKitFileCallback = (file: File) => void | { handleEvent(file: File): void; };
type WebKitFileCallback = ((file: File) => any) | { handleEvent(file: File): any; };

interface AnalyserNode extends AudioNode {
fftSize: number;
Expand Down Expand Up @@ -15435,6 +15435,7 @@ type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend";
type HeadersInit = Headers | string[][] | { [key: string]: string };
type AnimationKeyFrame = {offset?: number | null | (number | null)[]} & {[key: string]: string | number | number[] | string[]};
type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary";
type EventListenerOrEventListenerObject = EventListener;
type AppendMode = "segments" | "sequence";
type AudioContextState = "suspended" | "running" | "closed";
type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass";
Expand Down
3 changes: 2 additions & 1 deletion baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ interface SyncEventInit extends ExtendableEventInit {
lastChance?: boolean;
}

type EventListener = (evt: Event) => void | { handleEvent(evt: Event): void; };
type EventListener = ((evt: Event) => any) | { handleEvent(evt: Event): any; };

interface AudioBuffer {
readonly duration: number;
Expand Down Expand Up @@ -1911,6 +1911,7 @@ type IDBValidKey = number | string | Date | IDBArrayKey;
type BufferSource = ArrayBuffer | ArrayBufferView;
type FormDataEntryValue = string | File;
type HeadersInit = Headers | string[][] | { [key: string]: string };
type EventListenerOrEventListenerObject = EventListener;
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "pending" | "done";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
Expand Down
5 changes: 5 additions & 0 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -3002,5 +3002,10 @@
"signatures": [
"unlockOrientation(): void"
]
},
{
"kind": "typedef",
"name": "EventListenerOrEventListenerObject",
"type": "EventListener"
}
]