-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Migrate most of #core to pass TS typechecking (#37141)
* Pass tsc for #core/mode * Pass tsc for #core/constants * Pass tsc for #core/types * Pass tsc for #core/data-structures * Pass tsc for #core/error * Pass tsc for #core/document * Pass tsc for #core/window * Rebase/merge fix * Fix stragglers Pass tsc for #core/dom * Pass tsc for #core/*.js * Remove all extern files in core * Remove ! from annotations (used by closure, implied by TS) * Lint fixes * Add .d.ts to lint globs * Lint fixes * Remove outdated AsyncInput interface decl * Remove .d.ts from lint globs * `readonly` syntax instead of ReadonlyArray<> * Disable closure type-checking during presubmit. * Lint fixes * Lint fixes * Enable strict null checking and fix...everything * Rename tuple typedefs for uniqueness * Fix type definition files * Fix typedef location * Fix typos and type decls ofr AMP_REPORT_ERROR * Add missing fullscreen externs * More fullscreen typefills * Remove createdCallback from html-element.d.ts * Remove comment * Revert build-system/global.d.ts lint change
- Loading branch information
Showing
100 changed files
with
1,076 additions
and
938 deletions.
There are no files selected for viewing
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
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
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
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
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,9 @@ | ||
export {}; | ||
|
||
declare global { | ||
// AMP configuration and runtime settings structure. | ||
interface AmpConfigDef { | ||
test?: boolean; | ||
localDev?: boolean; | ||
} | ||
} |
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,7 @@ | ||
declare module '#core/assert' { | ||
function devAssert<T>(subject: T | null | undefined, msg?: string, ...any): T; | ||
function userAssert<T>(subject: T | null | undefined, msg?: string, ...any): T; | ||
function devAssertElement<T>(subject: T, msg?: string, ...any): HTMLElement; | ||
function devAssertString<T>(subject: T, msg?: string, ...any): string; | ||
function devAssertNumber<T>(subject: T, msg?: string, ...any): number; | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
// @ts-nocheck | ||
export * from './dev'; | ||
export * from './user'; |
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
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,17 @@ | ||
/** | ||
* Interface for all AMP Async Input Elements. | ||
* enforces the overridable function, getValue(). | ||
* Async Input should be implemented | ||
* by components like AMP form, to async request | ||
* a value from a component, and then be used for | ||
* some other action. For examples, this can be used | ||
* by reCAPTCHA to request tokens for the form. | ||
* | ||
* NOTE: Elements that implemented AsyncInput must | ||
* Also add and follow the other exported constants. | ||
* See amp-recaptcha-input as an example. | ||
*/ | ||
export interface AsyncInput { | ||
// Called to get the asynchronous value of an AsyncInput field. | ||
getValue: () => Promise<string>; | ||
} |
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
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
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
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
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
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
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
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
Oops, something went wrong.