sheetom 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +352 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -9
- package/dist/index.d.ts +64 -9
- package/dist/index.js +345 -38
- package/dist/index.js.map +1 -1
- package/docs/api.md +19 -1
- package/engine-abi.json +3 -3
- package/package.json +16 -15
package/dist/index.d.cts
CHANGED
|
@@ -763,6 +763,13 @@ declare class SheetOMSerializationError extends Error {
|
|
|
763
763
|
}
|
|
764
764
|
//#endregion
|
|
765
765
|
//#region src/index.d.ts
|
|
766
|
+
/** CSS authoring utilities, without installing or replacing the global CSS namespace. */
|
|
767
|
+
declare const CSS: {
|
|
768
|
+
/** Serialize a DOMString as a CSS identifier, including lone UTF-16 surrogates. */
|
|
769
|
+
escape(value: string): string;
|
|
770
|
+
/** Test a declaration or supports condition against the pinned authoring capabilities. */
|
|
771
|
+
supports(propertyOrCondition: string, value?: string): boolean;
|
|
772
|
+
};
|
|
766
773
|
/** One ordered declaration mutation executed by SheetOM's engine extension. */
|
|
767
774
|
type CSSDeclarationMutation = {
|
|
768
775
|
kind: "set";
|
|
@@ -880,6 +887,46 @@ declare class CSSFunctionRule extends CSSGroupingRule {
|
|
|
880
887
|
get cssText(): string;
|
|
881
888
|
set cssText(_value: string);
|
|
882
889
|
}
|
|
890
|
+
/** Experimental revision-pinned native CSS mixin definition. */
|
|
891
|
+
declare class CSSMixinRule extends CSSGroupingRule {
|
|
892
|
+
#private;
|
|
893
|
+
readonly name: string;
|
|
894
|
+
readonly contents = true;
|
|
895
|
+
private constructor();
|
|
896
|
+
getParameters(): FunctionParameter[];
|
|
897
|
+
get cssText(): string;
|
|
898
|
+
set cssText(_value: string);
|
|
899
|
+
}
|
|
900
|
+
/** Experimental native CSS mixin application with a contents block. */
|
|
901
|
+
declare class CSSApplyBlockRule extends CSSGroupingRule {
|
|
902
|
+
#private;
|
|
903
|
+
readonly name: string;
|
|
904
|
+
private constructor();
|
|
905
|
+
getArguments(): string[];
|
|
906
|
+
get cssText(): string;
|
|
907
|
+
set cssText(_value: string);
|
|
908
|
+
}
|
|
909
|
+
/** Experimental native CSS mixin application without a contents block. */
|
|
910
|
+
declare class CSSApplyStatementRule extends CSSRule {
|
|
911
|
+
#private;
|
|
912
|
+
readonly name: string;
|
|
913
|
+
private constructor();
|
|
914
|
+
getArguments(): string[];
|
|
915
|
+
get cssText(): string;
|
|
916
|
+
set cssText(_value: string);
|
|
917
|
+
}
|
|
918
|
+
/** Experimental native CSS mixin contents placeholder with a fallback block. */
|
|
919
|
+
declare class CSSContentsBlockRule extends CSSGroupingRule {
|
|
920
|
+
private constructor();
|
|
921
|
+
get cssText(): string;
|
|
922
|
+
set cssText(_value: string);
|
|
923
|
+
}
|
|
924
|
+
/** Experimental native CSS mixin contents placeholder without a fallback. */
|
|
925
|
+
declare class CSSContentsStatementRule extends CSSRule {
|
|
926
|
+
private constructor();
|
|
927
|
+
get cssText(): string;
|
|
928
|
+
set cssText(_value: string);
|
|
929
|
+
}
|
|
883
930
|
/** A live `@media` rule. */
|
|
884
931
|
declare class CSSMediaRule extends CSSConditionRule {
|
|
885
932
|
readonly media: MediaList;
|
|
@@ -1049,11 +1096,15 @@ declare class CSSPageRule extends CSSGroupingRule {
|
|
|
1049
1096
|
get cssText(): string;
|
|
1050
1097
|
set cssText(_value: string);
|
|
1051
1098
|
}
|
|
1052
|
-
/**
|
|
1099
|
+
/** The allowed descriptors of an anchor positioning fallback rule. */
|
|
1100
|
+
declare class CSSPositionTryDescriptors extends CSSStyleDeclaration {}
|
|
1101
|
+
/** A named anchor positioning fallback rule. */
|
|
1053
1102
|
declare class CSSPositionTryRule extends CSSRule {
|
|
1103
|
+
#private;
|
|
1054
1104
|
readonly name: string;
|
|
1055
|
-
readonly style: CSSStyleDeclaration;
|
|
1056
1105
|
private constructor();
|
|
1106
|
+
get style(): CSSPositionTryDescriptors;
|
|
1107
|
+
set style(cssText: string);
|
|
1057
1108
|
get cssText(): string;
|
|
1058
1109
|
set cssText(_value: string);
|
|
1059
1110
|
}
|
|
@@ -1151,19 +1202,23 @@ declare class CSSStyleRule extends CSSGroupingRule {
|
|
|
1151
1202
|
get cssText(): string;
|
|
1152
1203
|
set cssText(_value: string);
|
|
1153
1204
|
}
|
|
1154
|
-
/**
|
|
1155
|
-
declare class
|
|
1156
|
-
#private;
|
|
1157
|
-
readonly cssRules: CSSRuleList;
|
|
1205
|
+
/** Shared stylesheet metadata. Instances are created through CSSStyleSheet. */
|
|
1206
|
+
declare class StyleSheet {
|
|
1158
1207
|
readonly media: MediaList;
|
|
1159
1208
|
readonly ownerNode: null;
|
|
1160
1209
|
readonly parentStyleSheet: null;
|
|
1161
|
-
readonly ownerRule: null;
|
|
1162
1210
|
readonly title: null;
|
|
1163
1211
|
readonly type = "text/css";
|
|
1164
1212
|
disabled: boolean;
|
|
1165
|
-
constructor(
|
|
1213
|
+
protected constructor();
|
|
1166
1214
|
get href(): string | null;
|
|
1215
|
+
}
|
|
1216
|
+
/** A mutable, browser-shaped authoring stylesheet. */
|
|
1217
|
+
declare class CSSStyleSheet extends StyleSheet {
|
|
1218
|
+
#private;
|
|
1219
|
+
readonly cssRules: CSSRuleList;
|
|
1220
|
+
readonly ownerRule: null;
|
|
1221
|
+
constructor(options?: CSSStyleSheetOptions | null);
|
|
1167
1222
|
get baseURL(): string;
|
|
1168
1223
|
insertRule(ruleText: string, index?: number): number;
|
|
1169
1224
|
deleteRule(index: number): void;
|
|
@@ -1179,5 +1234,5 @@ declare class CSSStyleSheet {
|
|
|
1179
1234
|
/** Forgivingly parse an existing regular stylesheet without loading imports. */
|
|
1180
1235
|
declare function parseStyleSheet(cssText: string, options?: ParseStyleSheetOptions): CSSStyleSheet;
|
|
1181
1236
|
//#endregion
|
|
1182
|
-
export { CSSConditionRule, CSSContainerRule, CSSCounterStyleRule, CSSDeclarationMutation, CSSDeclarationMutationResult, CSSFontFaceRule, CSSFontFeatureValuesMap, CSSFontFeatureValuesRule, CSSFontPaletteValuesRule, CSSFunctionDeclarations, CSSFunctionDescriptors, CSSFunctionRule, CSSGroupingRule, CSSImportRule, CSSKeyframeRule, CSSKeyframesRule, CSSLayerBlockRule, CSSLayerStatementRule, CSSMarginRule, CSSMediaRule, CSSNamespaceRule, CSSNestedDeclarations, CSSPageRule, CSSPositionTryRule, CSSPropertyRule, CSSRule, CSSRuleList, CSSScopeRule, CSSStartingStyleRule, CSSStyleDeclaration, CSSStyleRule, CSSStyleSheet, CSSStyleSheetOptions, CSSSupportsRule, CSSViewTransitionRule, FunctionParameter, MediaList, ParseStyleSheetOptions, type SheetOMDiagnostic, type SheetOMDiagnosticCode, type SheetOMMutationDiagnostic, type SheetOMMutationDiagnosticCode, type SheetOMResourceBudget, type SheetOMSerializationDiagnostic, type SheetOMSerializationDiagnosticCode, SheetOMSerializationError, type SheetOMSerializationErrorCode, parseStyleSheet };
|
|
1237
|
+
export { CSS, CSSApplyBlockRule, CSSApplyStatementRule, CSSConditionRule, CSSContainerRule, CSSContentsBlockRule, CSSContentsStatementRule, CSSCounterStyleRule, CSSDeclarationMutation, CSSDeclarationMutationResult, CSSFontFaceRule, CSSFontFeatureValuesMap, CSSFontFeatureValuesRule, CSSFontPaletteValuesRule, CSSFunctionDeclarations, CSSFunctionDescriptors, CSSFunctionRule, CSSGroupingRule, CSSImportRule, CSSKeyframeRule, CSSKeyframesRule, CSSLayerBlockRule, CSSLayerStatementRule, CSSMarginRule, CSSMediaRule, CSSMixinRule, CSSNamespaceRule, CSSNestedDeclarations, CSSPageRule, CSSPositionTryDescriptors, CSSPositionTryRule, CSSPropertyRule, CSSRule, CSSRuleList, CSSScopeRule, CSSStartingStyleRule, CSSStyleDeclaration, CSSStyleRule, CSSStyleSheet, CSSStyleSheetOptions, CSSSupportsRule, CSSViewTransitionRule, FunctionParameter, MediaList, ParseStyleSheetOptions, type SheetOMDiagnostic, type SheetOMDiagnosticCode, type SheetOMMutationDiagnostic, type SheetOMMutationDiagnosticCode, type SheetOMResourceBudget, type SheetOMSerializationDiagnostic, type SheetOMSerializationDiagnosticCode, SheetOMSerializationError, type SheetOMSerializationErrorCode, StyleSheet, parseStyleSheet };
|
|
1183
1238
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -763,6 +763,13 @@ declare class SheetOMSerializationError extends Error {
|
|
|
763
763
|
}
|
|
764
764
|
//#endregion
|
|
765
765
|
//#region src/index.d.ts
|
|
766
|
+
/** CSS authoring utilities, without installing or replacing the global CSS namespace. */
|
|
767
|
+
declare const CSS: {
|
|
768
|
+
/** Serialize a DOMString as a CSS identifier, including lone UTF-16 surrogates. */
|
|
769
|
+
escape(value: string): string;
|
|
770
|
+
/** Test a declaration or supports condition against the pinned authoring capabilities. */
|
|
771
|
+
supports(propertyOrCondition: string, value?: string): boolean;
|
|
772
|
+
};
|
|
766
773
|
/** One ordered declaration mutation executed by SheetOM's engine extension. */
|
|
767
774
|
type CSSDeclarationMutation = {
|
|
768
775
|
kind: "set";
|
|
@@ -880,6 +887,46 @@ declare class CSSFunctionRule extends CSSGroupingRule {
|
|
|
880
887
|
get cssText(): string;
|
|
881
888
|
set cssText(_value: string);
|
|
882
889
|
}
|
|
890
|
+
/** Experimental revision-pinned native CSS mixin definition. */
|
|
891
|
+
declare class CSSMixinRule extends CSSGroupingRule {
|
|
892
|
+
#private;
|
|
893
|
+
readonly name: string;
|
|
894
|
+
readonly contents = true;
|
|
895
|
+
private constructor();
|
|
896
|
+
getParameters(): FunctionParameter[];
|
|
897
|
+
get cssText(): string;
|
|
898
|
+
set cssText(_value: string);
|
|
899
|
+
}
|
|
900
|
+
/** Experimental native CSS mixin application with a contents block. */
|
|
901
|
+
declare class CSSApplyBlockRule extends CSSGroupingRule {
|
|
902
|
+
#private;
|
|
903
|
+
readonly name: string;
|
|
904
|
+
private constructor();
|
|
905
|
+
getArguments(): string[];
|
|
906
|
+
get cssText(): string;
|
|
907
|
+
set cssText(_value: string);
|
|
908
|
+
}
|
|
909
|
+
/** Experimental native CSS mixin application without a contents block. */
|
|
910
|
+
declare class CSSApplyStatementRule extends CSSRule {
|
|
911
|
+
#private;
|
|
912
|
+
readonly name: string;
|
|
913
|
+
private constructor();
|
|
914
|
+
getArguments(): string[];
|
|
915
|
+
get cssText(): string;
|
|
916
|
+
set cssText(_value: string);
|
|
917
|
+
}
|
|
918
|
+
/** Experimental native CSS mixin contents placeholder with a fallback block. */
|
|
919
|
+
declare class CSSContentsBlockRule extends CSSGroupingRule {
|
|
920
|
+
private constructor();
|
|
921
|
+
get cssText(): string;
|
|
922
|
+
set cssText(_value: string);
|
|
923
|
+
}
|
|
924
|
+
/** Experimental native CSS mixin contents placeholder without a fallback. */
|
|
925
|
+
declare class CSSContentsStatementRule extends CSSRule {
|
|
926
|
+
private constructor();
|
|
927
|
+
get cssText(): string;
|
|
928
|
+
set cssText(_value: string);
|
|
929
|
+
}
|
|
883
930
|
/** A live `@media` rule. */
|
|
884
931
|
declare class CSSMediaRule extends CSSConditionRule {
|
|
885
932
|
readonly media: MediaList;
|
|
@@ -1049,11 +1096,15 @@ declare class CSSPageRule extends CSSGroupingRule {
|
|
|
1049
1096
|
get cssText(): string;
|
|
1050
1097
|
set cssText(_value: string);
|
|
1051
1098
|
}
|
|
1052
|
-
/**
|
|
1099
|
+
/** The allowed descriptors of an anchor positioning fallback rule. */
|
|
1100
|
+
declare class CSSPositionTryDescriptors extends CSSStyleDeclaration {}
|
|
1101
|
+
/** A named anchor positioning fallback rule. */
|
|
1053
1102
|
declare class CSSPositionTryRule extends CSSRule {
|
|
1103
|
+
#private;
|
|
1054
1104
|
readonly name: string;
|
|
1055
|
-
readonly style: CSSStyleDeclaration;
|
|
1056
1105
|
private constructor();
|
|
1106
|
+
get style(): CSSPositionTryDescriptors;
|
|
1107
|
+
set style(cssText: string);
|
|
1057
1108
|
get cssText(): string;
|
|
1058
1109
|
set cssText(_value: string);
|
|
1059
1110
|
}
|
|
@@ -1151,19 +1202,23 @@ declare class CSSStyleRule extends CSSGroupingRule {
|
|
|
1151
1202
|
get cssText(): string;
|
|
1152
1203
|
set cssText(_value: string);
|
|
1153
1204
|
}
|
|
1154
|
-
/**
|
|
1155
|
-
declare class
|
|
1156
|
-
#private;
|
|
1157
|
-
readonly cssRules: CSSRuleList;
|
|
1205
|
+
/** Shared stylesheet metadata. Instances are created through CSSStyleSheet. */
|
|
1206
|
+
declare class StyleSheet {
|
|
1158
1207
|
readonly media: MediaList;
|
|
1159
1208
|
readonly ownerNode: null;
|
|
1160
1209
|
readonly parentStyleSheet: null;
|
|
1161
|
-
readonly ownerRule: null;
|
|
1162
1210
|
readonly title: null;
|
|
1163
1211
|
readonly type = "text/css";
|
|
1164
1212
|
disabled: boolean;
|
|
1165
|
-
constructor(
|
|
1213
|
+
protected constructor();
|
|
1166
1214
|
get href(): string | null;
|
|
1215
|
+
}
|
|
1216
|
+
/** A mutable, browser-shaped authoring stylesheet. */
|
|
1217
|
+
declare class CSSStyleSheet extends StyleSheet {
|
|
1218
|
+
#private;
|
|
1219
|
+
readonly cssRules: CSSRuleList;
|
|
1220
|
+
readonly ownerRule: null;
|
|
1221
|
+
constructor(options?: CSSStyleSheetOptions | null);
|
|
1167
1222
|
get baseURL(): string;
|
|
1168
1223
|
insertRule(ruleText: string, index?: number): number;
|
|
1169
1224
|
deleteRule(index: number): void;
|
|
@@ -1179,5 +1234,5 @@ declare class CSSStyleSheet {
|
|
|
1179
1234
|
/** Forgivingly parse an existing regular stylesheet without loading imports. */
|
|
1180
1235
|
declare function parseStyleSheet(cssText: string, options?: ParseStyleSheetOptions): CSSStyleSheet;
|
|
1181
1236
|
//#endregion
|
|
1182
|
-
export { CSSConditionRule, CSSContainerRule, CSSCounterStyleRule, CSSDeclarationMutation, CSSDeclarationMutationResult, CSSFontFaceRule, CSSFontFeatureValuesMap, CSSFontFeatureValuesRule, CSSFontPaletteValuesRule, CSSFunctionDeclarations, CSSFunctionDescriptors, CSSFunctionRule, CSSGroupingRule, CSSImportRule, CSSKeyframeRule, CSSKeyframesRule, CSSLayerBlockRule, CSSLayerStatementRule, CSSMarginRule, CSSMediaRule, CSSNamespaceRule, CSSNestedDeclarations, CSSPageRule, CSSPositionTryRule, CSSPropertyRule, CSSRule, CSSRuleList, CSSScopeRule, CSSStartingStyleRule, CSSStyleDeclaration, CSSStyleRule, CSSStyleSheet, CSSStyleSheetOptions, CSSSupportsRule, CSSViewTransitionRule, FunctionParameter, MediaList, ParseStyleSheetOptions, type SheetOMDiagnostic, type SheetOMDiagnosticCode, type SheetOMMutationDiagnostic, type SheetOMMutationDiagnosticCode, type SheetOMResourceBudget, type SheetOMSerializationDiagnostic, type SheetOMSerializationDiagnosticCode, SheetOMSerializationError, type SheetOMSerializationErrorCode, parseStyleSheet };
|
|
1237
|
+
export { CSS, CSSApplyBlockRule, CSSApplyStatementRule, CSSConditionRule, CSSContainerRule, CSSContentsBlockRule, CSSContentsStatementRule, CSSCounterStyleRule, CSSDeclarationMutation, CSSDeclarationMutationResult, CSSFontFaceRule, CSSFontFeatureValuesMap, CSSFontFeatureValuesRule, CSSFontPaletteValuesRule, CSSFunctionDeclarations, CSSFunctionDescriptors, CSSFunctionRule, CSSGroupingRule, CSSImportRule, CSSKeyframeRule, CSSKeyframesRule, CSSLayerBlockRule, CSSLayerStatementRule, CSSMarginRule, CSSMediaRule, CSSMixinRule, CSSNamespaceRule, CSSNestedDeclarations, CSSPageRule, CSSPositionTryDescriptors, CSSPositionTryRule, CSSPropertyRule, CSSRule, CSSRuleList, CSSScopeRule, CSSStartingStyleRule, CSSStyleDeclaration, CSSStyleRule, CSSStyleSheet, CSSStyleSheetOptions, CSSSupportsRule, CSSViewTransitionRule, FunctionParameter, MediaList, ParseStyleSheetOptions, type SheetOMDiagnostic, type SheetOMDiagnosticCode, type SheetOMMutationDiagnostic, type SheetOMMutationDiagnosticCode, type SheetOMResourceBudget, type SheetOMSerializationDiagnostic, type SheetOMSerializationDiagnosticCode, SheetOMSerializationError, type SheetOMSerializationErrorCode, StyleSheet, parseStyleSheet };
|
|
1183
1238
|
//# sourceMappingURL=index.d.ts.map
|