-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
TypeScript Version: 3.9.2
Search Terms: CSS level 1 types lib dom
PR #37616 changed the definition of CSS
from an interface with a global var to a namespace.
// Before:
interface CSS {
escape(value: string): string;
supports(property: string, value?: string): boolean;
}
declare var CSS: CSS;
// After:
declare namespace CSS {
function escape(ident: string): string;
function supports(property: string, value: string): boolean;
function supports(conditionText: string): boolean;
}
In isolation, this is all fine.
But it breaks additional definitions for newer standards.
I reference @types/w3c-css-typed-object-model-level-1
for typed CSS OM, which uses the same interface + global var approach as TS 3.8.
Before it was working fine.
After 3.9, code such as CSS.px(42)
now errors with TS2339
'px' does not exist on type 'typeof CSS'
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone