@markuplint/types
Advanced tools
Comparing version 4.0.0-alpha.7 to 4.0.0-alpha.8
import type { CustomSyntaxCheck, UnmatchedResult } from './types.js'; | ||
export declare function checkMultiTypes(value: string, checks: readonly CustomSyntaxCheck[]): import("./types.js").MatchedResult | UnmatchedResult; | ||
export declare function checkMultiTypes(value: string, checks: readonly CustomSyntaxCheck[]): UnmatchedResult | import("./types.js").MatchedResult; |
import { fork } from 'css-tree'; | ||
import { log } from './debug.js'; | ||
import { tokenizers } from './defs.js'; | ||
import { tokenizers, overrides } from './defs.js'; | ||
import { matched } from './match-result.js'; | ||
@@ -55,3 +55,6 @@ const MIMIC_TAG_L = 'mimiccases---'; | ||
const lexer = fork({ | ||
types: typesExtended, | ||
types: { | ||
...overrides, | ||
...typesExtended, | ||
}, | ||
properties: propsExtended, | ||
@@ -58,0 +61,0 @@ }).lexer; |
import type { Defs, CssSyntaxTokenizer } from './types.js'; | ||
export declare const types: Defs; | ||
export declare const overrides: Record<string, string>; | ||
export declare const tokenizers: Record<string, CssSyntaxTokenizer>; |
@@ -848,2 +848,23 @@ import { checkMultiTypes } from './check-multi-types.js'; | ||
}; | ||
export const overrides = { | ||
// Alias | ||
'legacy-length-percentage': '<length> | <percentage> | <svg-length>', | ||
'legacy-angle': '<angle> | <zero> | <number>', | ||
/** | ||
* @see https://www.w3.org/TR/css-transforms-1/#funcdef-transform-translate | ||
*/ | ||
'translate()': 'translate( <legacy-length-percentage> , <legacy-length-percentage>? ) | translate( <legacy-length-percentage> <legacy-length-percentage>? )', | ||
/** | ||
* @see https://www.w3.org/TR/css-transforms-1/#funcdef-transform-scale | ||
*/ | ||
'scale()': 'scale( [ <number> | <percentage> ]#{1,2} )', | ||
/** | ||
* @see https://www.w3.org/TR/css-transforms-1/#funcdef-transform-rotate | ||
*/ | ||
'rotate()': 'rotate( <legacy-angle> )', | ||
/** | ||
* @see https://www.w3.org/TR/css-transforms-1/#funcdef-transform-skew | ||
*/ | ||
'skew()': 'skew( <legacy-angle> , <legacy-angle>? ) | skew( <legacy-angle> <legacy-angle>? )', | ||
}; | ||
export const tokenizers = { | ||
@@ -850,0 +871,0 @@ // RFC |
@@ -5,3 +5,3 @@ import type { FormattedPrimitiveTypeCheck, MatchedResult, UnmatchedResult, UnmatchedResultOptions, UnmatchedResultReason } from './types.js'; | ||
readonly reason?: UnmatchedResultReason; | ||
}): (value: string) => MatchedResult | UnmatchedResult; | ||
}): (value: string) => UnmatchedResult | MatchedResult; | ||
export declare function matched(): MatchedResult; | ||
@@ -8,0 +8,0 @@ export declare function unmatched(value: string, reason?: UnmatchedResultReason, options?: UnmatchedResultOptions & { |
@@ -27,3 +27,3 @@ import type { TokenValue } from './types.js'; | ||
cache?: boolean; | ||
}): import("../types.js").MatchedResult | UnmatchedResult; | ||
}): UnmatchedResult | import("../types.js").MatchedResult; | ||
chunk(split: number): TokenCollection[]; | ||
@@ -30,0 +30,0 @@ compareTokens(callback: (prev: Readonly<Token>, current: Readonly<Token>) => Readonly<Token> | null | void): Readonly<Token> | null | undefined; |
{ | ||
"name": "@markuplint/types", | ||
"version": "4.0.0-alpha.7", | ||
"version": "4.0.0-alpha.8", | ||
"description": "Type declaration and value checker", | ||
@@ -42,3 +42,3 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
}, | ||
"gitHead": "571129bf6498541125e1e7c3907d5ed9af53459a" | ||
"gitHead": "5bcd25f13ff804af0d09aaabd87e495af668e6a8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227674
5735