Skip to content
Merged
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
10 changes: 7 additions & 3 deletions TS.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ module InputJson =

let getItemByName (allItems: InputJsonType.Root []) (itemName: string) (kind: ItemKind) otherFilter =
let filter (item: InputJsonType.Root) =
OptionCheckValue itemName item.Name &&
(OptionCheckValue itemName item.Name || OptionCheckValue (sprintf "%s?" itemName) item.Name) &&
item.Kind.ToLower() = kind.ToString() &&
otherFilter item
allItems |> Array.tryFind filter
Expand Down Expand Up @@ -1066,7 +1066,7 @@ module Emit =
| _ -> ()

let EmitEventHandlers (flavor: Flavor) (prefix: string) (i:Browser.Interface) =
let getOptionsType (addOrRemove: string) =
let getOptionsType (addOrRemove: string) =
if addOrRemove = "add" then "AddEventListenerOptions" else "EventListenerOptions"

let fPrefix =
Expand Down Expand Up @@ -1393,7 +1393,11 @@ module Emit =
| _ -> Pt.Printl "interface %s extends %s {" dict.Name dict.Extends

let emitJsonProperty (p: InputJsonType.Root) =
Pt.Printl "%s: %s;" p.Name.Value p.Type.Value
let readOnlyModifier =
match p.Readonly with
| Some(true) -> "readonly "
| _ -> ""
Pt.Printl "%s%s: %s;" readOnlyModifier p.Name.Value p.Type.Value

let removedPropNames =
getRemovedItems ItemKind.Property flavor
Expand Down
10 changes: 5 additions & 5 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ interface IDBIndexParameters {

interface IDBObjectStoreParameters {
autoIncrement?: boolean;
keyPath?: IDBKeyPath | null;
keyPath?: string | string[];
}

interface IntersectionObserverEntryInit {
Expand Down Expand Up @@ -773,7 +773,7 @@ interface RequestInit {
body?: any;
cache?: RequestCache;
credentials?: RequestCredentials;
headers?: Headers | string[][];
headers?: HeadersInit;
integrity?: string;
keepalive?: boolean;
method?: string;
Expand All @@ -785,7 +785,7 @@ interface RequestInit {
}

interface ResponseInit {
headers?: Headers | string[][];
headers?: HeadersInit;
status?: number;
statusText?: string;
}
Expand Down Expand Up @@ -3901,7 +3901,7 @@ interface Headers {

declare var Headers: {
prototype: Headers;
new(init?: Headers | string[][] | object): Headers;
new(init?: HeadersInit): Headers;
};

interface History {
Expand Down Expand Up @@ -15115,7 +15115,6 @@ type GLsizeiptr = number;
type GLubyte = number;
type GLuint = number;
type GLushort = number;
type HeadersInit = Headers | string[][];
type IDBKeyPath = string;
type KeyFormat = string;
type KeyType = string;
Expand All @@ -15136,6 +15135,7 @@ type MouseWheelEvent = WheelEvent;
type ScrollRestoration = "auto" | "manual";
type FormDataEntryValue = string | File;
type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend";
type HeadersInit = string[][] | { [key: string]: string };
type AppendMode = "segments" | "sequence";
type AudioContextState = "suspended" | "running" | "closed";
type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass";
Expand Down
9 changes: 5 additions & 4 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface IDBIndexParameters {

interface IDBObjectStoreParameters {
autoIncrement?: boolean;
keyPath?: IDBKeyPath | null;
keyPath?: string | string[];
}

interface KeyAlgorithm {
Expand Down Expand Up @@ -74,7 +74,7 @@ interface RequestInit {
body?: any;
cache?: RequestCache;
credentials?: RequestCredentials;
headers?: Headers | string[][];
headers?: HeadersInit;
integrity?: string;
keepalive?: boolean;
method?: string;
Expand All @@ -86,7 +86,7 @@ interface RequestInit {
}

interface ResponseInit {
headers?: Headers | string[][];
headers?: HeadersInit;
status?: number;
statusText?: string;
}
Expand Down Expand Up @@ -472,7 +472,7 @@ interface Headers {

declare var Headers: {
prototype: Headers;
new(init?: Headers | string[][] | object): Headers;
new(init?: HeadersInit): Headers;
};

interface IDBCursor {
Expand Down Expand Up @@ -1890,6 +1890,7 @@ type USVString = string;
type IDBValidKey = number | string | Date | IDBArrayKey;
type BufferSource = ArrayBuffer | ArrayBufferView;
type FormDataEntryValue = string | File;
type HeadersInit = string[][] | { [key: string]: string };
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "pending" | "done";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
Expand Down
Loading