Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Emit enums as union types instead of current string#221

Merged
mhegazy merged 7 commits into
microsoft:mastermicrosoft/TypeScript-DOM-lib-generator:masterfrom
saschanaz:enumssaschanaz/types-web:enumsCopy head branch name to clipboard
Mar 30, 2017
Merged

Emit enums as union types instead of current string#221
mhegazy merged 7 commits into
microsoft:mastermicrosoft/TypeScript-DOM-lib-generator:masterfrom
saschanaz:enumssaschanaz/types-web:enumsCopy head branch name to clipboard

Conversation

@saschanaz

Copy link
Copy Markdown
Contributor

Fixes #200

Current:

interface Request extends Object, Body {
    readonly cache: string;
    readonly credentials: string;
    readonly destination: string;
    readonly headers: Headers;
    readonly integrity: string;
    readonly keepalive: boolean;
    readonly method: string;
    readonly mode: string;
    readonly redirect: string;
    readonly referrer: string;
    readonly referrerPolicy: string;
    readonly type: string;
    readonly url: string;
    clone(): Request;
}

Fixed:

interface Request extends Object, Body {
    readonly cache: RequestCache;
    readonly credentials: RequestCredentials;
    readonly destination: RequestDestination;
    readonly headers: Headers;
    readonly integrity: string;
    readonly keepalive: boolean;
    readonly method: string;
    readonly mode: RequestMode;
    readonly redirect: RequestRedirect;
    readonly referrer: string;
    readonly referrerPolicy: ReferrerPolicy;
    readonly type: RequestType;
    readonly url: string;
    clone(): Request;
}

type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache";
type RequestCredentials = "omit" | "same-origin" | "include";
type RequestDestination = "" | "document" | "sharedworker" | "subresource" | "unknown" | "worker";
type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors";
type RequestRedirect = "follow" | "error" | "manual";
type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video";

@saschanaz

Copy link
Copy Markdown
Contributor Author

Will reopen after fixing build.

@saschanaz saschanaz closed this Mar 27, 2017
@mhegazy

mhegazy commented Mar 29, 2017

Copy link
Copy Markdown
Contributor

@zhengbli can you please review this change?

@zhengbli

Copy link
Copy Markdown

LGTM

@zhengbli

Copy link
Copy Markdown

Thanks @saschanaz !

@mhegazy

mhegazy commented Mar 30, 2017

Copy link
Copy Markdown
Contributor

We need to document this as a breaking change.

@mhegazy mhegazy merged commit 8053340 into microsoft:master Mar 30, 2017
@saschanaz saschanaz deleted the enums branch March 30, 2017 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.