Skip to content

Commit

Permalink
Remove const enum in Features type
Browse files Browse the repository at this point in the history
Closes #564
  • Loading branch information
devongovett committed Aug 19, 2023
1 parent c7913b0 commit 4956d9b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
50 changes: 25 additions & 25 deletions node/targets.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ export interface Targets {
samsung?: number
}

export declare const enum Features {
Nesting = 1,
NotSelectorList = 2,
DirSelector = 4,
LangSelectorList = 8,
IsSelector = 16,
TextDecorationThicknessPercent = 32,
MediaIntervalSyntax = 64,
MediaRangeSyntax = 128,
CustomMediaQueries = 256,
ClampFunction = 512,
ColorFunction = 1024,
OklabColors = 2048,
LabColors = 4096,
P3Colors = 8192,
HexAlphaColors = 16384,
SpaceSeparatedColorNotation = 32768,
FontFamilySystemUi = 65536,
DoublePositionGradients = 131072,
VendorPrefixes = 262144,
LogicalProperties = 524288,
Selectors = 31,
MediaQueries = 448,
Colors = 64512,
}
export const Features: {
Nesting: 1,
NotSelectorList: 2,
DirSelector: 4,
LangSelectorList: 8,
IsSelector: 16,
TextDecorationThicknessPercent: 32,
MediaIntervalSyntax: 64,
MediaRangeSyntax: 128,
CustomMediaQueries: 256,
ClampFunction: 512,
ColorFunction: 1024,
OklabColors: 2048,
LabColors: 4096,
P3Colors: 8192,
HexAlphaColors: 16384,
SpaceSeparatedColorNotation: 32768,
FontFamilySystemUi: 65536,
DoublePositionGradients: 131072,
VendorPrefixes: 262144,
LogicalProperties: 524288,
Selectors: 31,
MediaQueries: 448,
Colors: 64512,
};
8 changes: 4 additions & 4 deletions scripts/build-prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,15 @@ export interface Targets {
${allBrowsers.join('?: number,\n ')}?: number
}
export declare const enum Features {
export const Features: {
${flags.map((flag, i) => {
if (Array.isArray(flag)) {
return `${flag[0]} = ${flag[1].reduce((p, f) => p | (1 << flags.indexOf(f)), 0)},`
return `${flag[0]}: ${flag[1].reduce((p, f) => p | (1 << flags.indexOf(f)), 0)},`
} else {
return `${flag} = ${1 << i},`;
return `${flag}: ${1 << i},`;
}
}).join('\n ')}
}
};
`;

fs.writeFileSync('node/targets.d.ts', targets_dts);
Expand Down

0 comments on commit 4956d9b

Please sign in to comment.