-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: move
dist/module
to lib
and export flow types
Moving esm files to `lib/` folder gives us a path to stop importing from `src/` when importing files for treeshaking. We can migrate to importing from `lib/` and still have flow definitions at the ready Tasks Completed: - Remove module folder - Output transpiled code and flow defs to `lib/`
- Loading branch information
Showing
16 changed files
with
1,181 additions
and
68 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* @flow */ | ||
|
||
export const PROTOCOL = { | ||
MOCK: ('mock:' : 'mock:'), | ||
FILE: ('file:' : 'file:'), | ||
ABOUT: ('about:' : 'about:') | ||
}; | ||
|
||
export const WILDCARD = '*'; | ||
|
||
export const WINDOW_TYPE = { | ||
IFRAME: ('iframe' : 'iframe'), | ||
POPUP: ('popup' : 'popup') | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* @flow */ | ||
|
||
export * from './utils'; | ||
export * from './types'; | ||
export * from './constants'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* @flow */ | ||
|
||
// export something to force webpack to see this as an ES module | ||
export const TYPES = true; | ||
|
||
export type CrossDomainLocationType = {| | ||
|
||
|}; | ||
|
||
export type CrossDomainWindowType = {| | ||
location : string | CrossDomainLocationType, | ||
self : CrossDomainWindowType, | ||
closed : boolean, | ||
open : (string, string, string) => CrossDomainWindowType, | ||
close : () => void, | ||
focus : () => void, | ||
top : CrossDomainWindowType, | ||
frames : $ReadOnlyArray<CrossDomainWindowType>, | ||
opener ? : CrossDomainWindowType, | ||
parent : CrossDomainWindowType, | ||
length : number, | ||
postMessage : (string, string) => void | ||
|}; | ||
|
||
export type SameDomainWindowType = Object & {| | ||
location : string | Object, | ||
self : CrossDomainWindowType, | ||
closed : boolean, | ||
open : (string, string, string) => CrossDomainWindowType, | ||
close : () => void, | ||
focus : () => void, | ||
XMLHttpRequest : typeof XMLHttpRequest, | ||
document : Document, | ||
navigator : {| | ||
userAgent : string, | ||
mockUserAgent? : string | ||
|} | ||
|}; | ||
|
||
export type DomainMatcher = string | $ReadOnlyArray<string> | $ReadOnlyArray<string> | RegExp; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* @flow */ | ||
|
||
export function isRegex(item : mixed) : boolean { | ||
// $FlowFixMe method-unbinding | ||
return Object.prototype.toString.call(item) === '[object RegExp]'; | ||
} | ||
|
||
// eslint-disable-next-line no-unused-vars | ||
export function noop(...args : $ReadOnlyArray<mixed>) { | ||
// pass | ||
} |
File renamed without changes.
Oops, something went wrong.