-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typechecking carousel: remove shame files #37213
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,17 @@ | |
"allowJs": true, | ||
"checkJs": true, | ||
"noEmit": true, | ||
"paths": {} | ||
"downlevelIteration": true, | ||
"target": "esnext", | ||
"moduleResolution": "node", | ||
"paths": { | ||
"#compiler": ["../../../src/compiler"], | ||
"#compiler/*": ["../../../src/compiler/*"], | ||
"#core": ["../../../src/core"], | ||
"#core/*": ["../../../src/core/*"], | ||
"#third_party/*": ["../../../third_party/*"] | ||
} | ||
}, | ||
"include": ["*.js", "**/*.d.ts", "../../../src/*.d.ts"], | ||
"exclude": [] | ||
"include": ["*.js", "**/*.d.ts", "../../../src/**/*.d.ts"], | ||
"exclude": ["../../../src/purifier/index.d.ts"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you still extend the base here, but override the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll test it out. The thing I'm more concerned about is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea! We cannot fully do this yet bc of paths. The rest works! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we add |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,9 +107,6 @@ declare namespace AMP { | |
) => void; | ||
} | ||
|
||
// TODO(samouri): Move the types below to better locations. | ||
declare type AmpElement = HTMLElement; | ||
|
||
declare type Layout = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sick. I'll do that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok that didn't work. Cannot import a module from an ambient context :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be able to import it from within the namespace, though, which is where the types are used (or just import inline on lines 27/28 |
||
| 'nodisplay' | ||
| 'fixed' | ||
|
@@ -136,6 +133,3 @@ declare type LayoutRect = { | |
type Mutations = { | ||
[key: string]: null | boolean | string | number | Array<any> | Object; | ||
}; | ||
|
||
// TODO:(samouri): correctly type this within src/core/types/object/json | ||
declare type JsonObject = any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this guaranteed to be DIVs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Technically we aren't even guaranteed they will be HTMLElements..but we currently have code that assumes they are.
I'll cast to HTMLElement for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
realChildElements
returns an array of the same type aselement
, so ifelement
is properly typed toHTMLElement
, an additional cast shouldn't be necessaryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know that! Very cool. Is it correct though? I think
realChildElements
can legitimately returnElement
(i.e. SVG or HTML)