@adguard/agtree 3.3.0 → 3.4.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/ast-utils/clone.js +1 -1
- package/dist/ast-utils/modifiers.js +1 -1
- package/dist/ast-utils/network-rules.js +1 -1
- package/dist/ast-utils/scriptlets.js +1 -1
- package/dist/common/abp-snippet-injection-body-common.js +1 -1
- package/dist/common/agent-common.js +1 -1
- package/dist/common/ubo-selector-common.js +1 -1
- package/dist/compatibility-tables/base.js +2 -2
- package/dist/compatibility-tables/compatibility-table-data.js +1 -1
- package/dist/compatibility-tables/modifiers.js +4 -3
- package/dist/compatibility-tables/platforms.js +32 -30
- package/dist/compatibility-tables/redirects.js +11 -7
- package/dist/compatibility-tables/schemas/base.js +1 -1
- package/dist/compatibility-tables/schemas/modifier.js +1 -1
- package/dist/compatibility-tables/schemas/platform.js +57 -4
- package/dist/compatibility-tables/schemas/redirect.js +1 -1
- package/dist/compatibility-tables/schemas/resource-type.js +1 -1
- package/dist/compatibility-tables/schemas/scriptlet.js +1 -1
- package/dist/compatibility-tables/scriptlets.js +1 -1
- package/dist/compatibility-tables/utils/platform-helpers.js +290 -7
- package/dist/compatibility-tables/utils/resource-type-helpers.js +2 -2
- package/dist/compatibility-tables/utils/zod-camelcase.js +1 -1
- package/dist/converter/base-interfaces/base-converter.js +1 -1
- package/dist/converter/base-interfaces/conversion-result.js +1 -1
- package/dist/converter/base-interfaces/rule-converter-base.js +1 -1
- package/dist/converter/comment/index.js +1 -1
- package/dist/converter/cosmetic/css.js +1 -1
- package/dist/converter/cosmetic/element-hiding.js +1 -1
- package/dist/converter/cosmetic/header-removal.js +1 -1
- package/dist/converter/cosmetic/html.js +1 -1
- package/dist/converter/cosmetic/index.js +1 -1
- package/dist/converter/cosmetic/rule-modifiers/adg.js +1 -1
- package/dist/converter/cosmetic/rule-modifiers/ubo.js +2 -1
- package/dist/converter/cosmetic/scriptlet.js +1 -1
- package/dist/converter/css/index.js +2 -1
- package/dist/converter/data/css.js +1 -1
- package/dist/converter/filter-list.js +1 -1
- package/dist/converter/index.js +1 -1
- package/dist/converter/misc/network-rule-modifier.js +1 -1
- package/dist/converter/network/index.js +1 -1
- package/dist/converter/raw-filter-list.js +1 -1
- package/dist/converter/raw-rule.js +2 -1
- package/dist/converter/rule.js +1 -1
- package/dist/deserializer/base-deserializer.js +1 -1
- package/dist/deserializer/comment/agent-comment-deserializer.js +1 -1
- package/dist/deserializer/comment/agent-deserializer.js +1 -1
- package/dist/deserializer/comment/comment-rule-deserializer.js +1 -1
- package/dist/deserializer/comment/config-comment-deserializer.js +1 -1
- package/dist/deserializer/comment/hint-comment-deserializer.js +1 -1
- package/dist/deserializer/comment/hint-deserializer.js +1 -1
- package/dist/deserializer/comment/metadata-comment-deserializer.js +1 -1
- package/dist/deserializer/comment/pre-processor-comment-deserializer.js +1 -1
- package/dist/deserializer/comment/simple-comment-deserializer.js +1 -1
- package/dist/deserializer/cosmetic/cosmetic-rule-deserializer.js +1 -1
- package/dist/deserializer/cosmetic/css-injection-body-deserializer.js +1 -1
- package/dist/deserializer/cosmetic/element-hiding-body-deserializer.js +1 -1
- package/dist/deserializer/cosmetic/scriptlet-body/abp-snippet-injection-body-deserializer.js +1 -1
- package/dist/deserializer/cosmetic/scriptlet-body/adg-scriptlet-injection-body-deserializer.js +1 -1
- package/dist/deserializer/cosmetic/scriptlet-body/scriptlet-body-deserializer.js +1 -1
- package/dist/deserializer/cosmetic/scriptlet-body/ubo-scriptlet-injection-body-deserializer.js +1 -1
- package/dist/deserializer/empty-rule-deserializer.js +1 -1
- package/dist/deserializer/filterlist-deserializer.js +1 -1
- package/dist/deserializer/index.js +1 -1
- package/dist/deserializer/invalid-rule-deserializer.js +1 -1
- package/dist/deserializer/invalid-rule-error-node-deserializer.js +1 -1
- package/dist/deserializer/misc/domain-list-deserializer.js +1 -1
- package/dist/deserializer/misc/list-item-deserializer.js +1 -1
- package/dist/deserializer/misc/list-items-deserializer.js +1 -1
- package/dist/deserializer/misc/logical-expression-deserializer.js +1 -1
- package/dist/deserializer/misc/modifier-deserializer.js +1 -1
- package/dist/deserializer/misc/modifier-list-deserializer.js +1 -1
- package/dist/deserializer/misc/parameter-list-deserializer.js +1 -1
- package/dist/deserializer/misc/value-deserializer.js +1 -1
- package/dist/deserializer/network/host-rule-deserializer.js +1 -1
- package/dist/deserializer/network/hostname-list-deserializer.js +1 -1
- package/dist/deserializer/network/network-rule-deserializer.js +1 -1
- package/dist/deserializer/rule-deserializer.js +1 -1
- package/dist/deserializer/syntax-deserialization-map.js +1 -1
- package/dist/errors/adblock-syntax-error.js +1 -1
- package/dist/errors/binary-schema-mismatch-error.js +1 -1
- package/dist/errors/not-implemented-error.js +1 -1
- package/dist/errors/rule-conversion-error.js +1 -1
- package/dist/generator/base-generator.js +1 -1
- package/dist/generator/comment/agent-comment-generator.js +1 -1
- package/dist/generator/comment/agent-generator.js +1 -1
- package/dist/generator/comment/comment-rule-generator.js +1 -1
- package/dist/generator/comment/config-comment-generator.js +1 -1
- package/dist/generator/comment/hint-comment-generator.js +1 -1
- package/dist/generator/comment/hint-generator.js +1 -1
- package/dist/generator/comment/metadata-comment-generator.js +1 -1
- package/dist/generator/comment/pre-processor-comment-generator.js +1 -1
- package/dist/generator/comment/simple-comment-generator.js +1 -1
- package/dist/generator/cosmetic/body/abp-snippet-injection-body-generator.js +1 -1
- package/dist/generator/cosmetic/body/adg-scriptlet-injection-body-generator.js +1 -1
- package/dist/generator/cosmetic/body/ubo-scriptlet-injection-body-generator.js +1 -1
- package/dist/generator/cosmetic/cosmetic-rule-body-generator.js +1 -1
- package/dist/generator/cosmetic/cosmetic-rule-generator.js +1 -1
- package/dist/generator/cosmetic/cosmetic-rule-pattern-generator.js +1 -1
- package/dist/generator/css/adg-css-injection-generator.js +1 -1
- package/dist/generator/filterlist-generator.js +1 -1
- package/dist/generator/index.js +1 -1
- package/dist/generator/misc/domain-list-generator.js +1 -1
- package/dist/generator/misc/list-items-generator.js +1 -1
- package/dist/generator/misc/logical-expression-generator.js +1 -1
- package/dist/generator/misc/modifier-generator.js +1 -1
- package/dist/generator/misc/modifier-list-generator.js +1 -1
- package/dist/generator/misc/parameter-list-generator.js +1 -1
- package/dist/generator/misc/value-generator.js +1 -1
- package/dist/generator/network/host-rule-generator.js +1 -1
- package/dist/generator/network/network-rule-generator.js +1 -1
- package/dist/generator/rule-generator.js +1 -1
- package/dist/index.js +4 -4
- package/dist/marshalling-utils/comment/agent-comment-common.js +1 -1
- package/dist/marshalling-utils/comment/agent-common.js +1 -1
- package/dist/marshalling-utils/comment/config-comment-common.js +1 -1
- package/dist/marshalling-utils/comment/hint-comment-common.js +1 -1
- package/dist/marshalling-utils/comment/hint-common.js +1 -1
- package/dist/marshalling-utils/comment/metadata-comment-common.js +1 -1
- package/dist/marshalling-utils/comment/pre-processor-comment-common.js +1 -1
- package/dist/marshalling-utils/comment/simple-comment-common.js +1 -1
- package/dist/marshalling-utils/cosmetic/body/abp-snippet-injection-body-common.js +1 -1
- package/dist/marshalling-utils/cosmetic/body/adg-scriptlet-injection-body-common.js +1 -1
- package/dist/marshalling-utils/cosmetic/body/css-injection-body-common.js +1 -1
- package/dist/marshalling-utils/cosmetic/body/element-hiding-body-common.js +1 -1
- package/dist/marshalling-utils/cosmetic/body/ubo-scriptlet-injection-body-common.js +1 -1
- package/dist/marshalling-utils/cosmetic/cosmetic-rule-common.js +1 -1
- package/dist/marshalling-utils/empty-rule-common.js +1 -1
- package/dist/marshalling-utils/filter-list-common.js +1 -1
- package/dist/marshalling-utils/invalid-rule-common.js +1 -1
- package/dist/marshalling-utils/invalid-rule-error-node-common.js +1 -1
- package/dist/marshalling-utils/misc/binary-type-common.js +1 -1
- package/dist/marshalling-utils/misc/domain-list-common.js +1 -1
- package/dist/marshalling-utils/misc/host-rule-common.js +1 -1
- package/dist/marshalling-utils/misc/hostname-list-common.js +1 -1
- package/dist/marshalling-utils/misc/list-item-common.js +1 -1
- package/dist/marshalling-utils/misc/logical-expression-common.js +1 -1
- package/dist/marshalling-utils/misc/modifier-common.js +1 -1
- package/dist/marshalling-utils/misc/modifier-list-common.js +1 -1
- package/dist/marshalling-utils/misc/parameter-list-common.js +1 -1
- package/dist/marshalling-utils/misc/value-common.js +1 -1
- package/dist/marshalling-utils/network/network-rule-common.js +1 -1
- package/dist/marshalling-utils/syntax-serialization-map.js +1 -1
- package/dist/nodes/index.js +1 -1
- package/dist/package.json.js +2 -2
- package/dist/parser/base-parser.js +1 -1
- package/dist/parser/comment/agent-comment-parser.js +1 -1
- package/dist/parser/comment/agent-parser.js +1 -1
- package/dist/parser/comment/comment-parser.js +1 -1
- package/dist/parser/comment/config-comment-parser.js +1 -1
- package/dist/parser/comment/hint-comment-parser.js +1 -1
- package/dist/parser/comment/hint-parser.js +1 -1
- package/dist/parser/comment/metadata-comment-parser.js +1 -1
- package/dist/parser/comment/preprocessor-parser.js +1 -1
- package/dist/parser/comment/simple-comment-parser.js +1 -1
- package/dist/parser/cosmetic/body/abp-snippet-injection-body-parser.js +1 -1
- package/dist/parser/cosmetic/body/adg-scriptlet-injection-body-parser.js +1 -1
- package/dist/parser/cosmetic/body/ubo-scriptlet-injection-body-parser.js +1 -1
- package/dist/parser/cosmetic/cosmetic-rule-parser.js +1 -1
- package/dist/parser/css/adg-css-injection-parser.js +1 -1
- package/dist/parser/css/balancing.js +1 -1
- package/dist/parser/css/constants.js +1 -1
- package/dist/parser/css/css-token-stream.js +1 -1
- package/dist/parser/css/ubo-selector-parser.js +1 -1
- package/dist/parser/filterlist-parser.js +1 -1
- package/dist/parser/index.js +1 -1
- package/dist/parser/misc/app-list-parser.js +1 -1
- package/dist/parser/misc/domain-list-parser.js +1 -1
- package/dist/parser/misc/list-items-parser.js +1 -1
- package/dist/parser/misc/logical-expression-parser.js +1 -1
- package/dist/parser/misc/method-list-parser.js +1 -1
- package/dist/parser/misc/modifier-list.js +1 -1
- package/dist/parser/misc/modifier-parser.js +1 -1
- package/dist/parser/misc/parameter-list-parser.js +1 -1
- package/dist/parser/misc/stealth-option-list-parser.js +1 -1
- package/dist/parser/misc/ubo-parameter-list-parser.js +1 -1
- package/dist/parser/misc/value-parser.js +1 -1
- package/dist/parser/network/host-rule-parser.js +1 -1
- package/dist/parser/network/network-rule-parser.js +1 -1
- package/dist/parser/options.js +1 -1
- package/dist/parser/rule-parser.js +1 -1
- package/dist/serializer/base-serializer.js +1 -1
- package/dist/serializer/comment/agent-comment-serializer.js +1 -1
- package/dist/serializer/comment/agent-serializer.js +1 -1
- package/dist/serializer/comment/comment-rule-serializer.js +1 -1
- package/dist/serializer/comment/config-comment-serializer.js +1 -1
- package/dist/serializer/comment/hint-comment-serializer.js +1 -1
- package/dist/serializer/comment/hint-serializer.js +1 -1
- package/dist/serializer/comment/metadata-comment-serializer.js +1 -1
- package/dist/serializer/comment/pre-processor-comment-serializer.js +1 -1
- package/dist/serializer/comment/simple-comment-serializer.js +1 -1
- package/dist/serializer/cosmetic/body/abp-snippet-injection-body-serializer.js +1 -1
- package/dist/serializer/cosmetic/body/adg-scriptlet-injection-body-serializer.js +1 -1
- package/dist/serializer/cosmetic/body/scriptlet-body-serializer.js +1 -1
- package/dist/serializer/cosmetic/body/ubo-scriptlet-injection-body-serializer.js +1 -1
- package/dist/serializer/cosmetic/cosmetic-rule-serializer.js +1 -1
- package/dist/serializer/cosmetic/css-injection-body-serializer.js +1 -1
- package/dist/serializer/cosmetic/element-hiding-body-serializer.js +1 -1
- package/dist/serializer/empty-rule-serializer.js +1 -1
- package/dist/serializer/filterlist-serializer.js +1 -1
- package/dist/serializer/index.js +1 -1
- package/dist/serializer/invalid-rule-error-node-serializer.js +1 -1
- package/dist/serializer/invalid-rule-serializer.js +1 -1
- package/dist/serializer/misc/domain-list-serializer.js +1 -1
- package/dist/serializer/misc/list-item-serializer.js +1 -1
- package/dist/serializer/misc/list-items-serializer.js +1 -1
- package/dist/serializer/misc/logical-expression-serializer.js +1 -1
- package/dist/serializer/misc/modifier-list-serializer.js +1 -1
- package/dist/serializer/misc/modifier-serializer.js +1 -1
- package/dist/serializer/misc/parameter-list-serializer.js +1 -1
- package/dist/serializer/misc/value-serializer.js +1 -1
- package/dist/serializer/network/host-rule-serializer.js +1 -1
- package/dist/serializer/network/hostname-list-serializer.js +1 -1
- package/dist/serializer/network/network-rule-serializer.js +1 -1
- package/dist/serializer/rule-serializer.js +1 -1
- package/dist/types/compatibility-tables/base.d.ts +11 -11
- package/dist/types/compatibility-tables/index.d.ts +3 -2
- package/dist/types/compatibility-tables/platforms.d.ts +67 -33
- package/dist/types/compatibility-tables/redirects.d.ts +3 -3
- package/dist/types/compatibility-tables/schemas/base.d.ts +1 -1
- package/dist/types/compatibility-tables/schemas/platform.d.ts +16 -5
- package/dist/types/compatibility-tables/utils/platform-helpers.d.ts +112 -3
- package/dist/types/compatibility-tables/utils/resource-type-helpers.d.ts +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/utils/adblockers.d.ts +28 -0
- package/dist/types/utils/bit-count.d.ts +21 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/noop-modifier.d.ts +8 -0
- package/dist/types/utils/storage-interface.d.ts +1 -1
- package/dist/types/utils/types.d.ts +21 -0
- package/dist/types/validator/constants.d.ts +0 -9
- package/dist/types/validator/helpers.d.ts +0 -8
- package/dist/types/validator/index.d.ts +10 -9
- package/dist/utils/adblockers.js +28 -5
- package/dist/utils/binary-schema-version.js +1 -1
- package/dist/utils/bit-count.js +37 -0
- package/dist/utils/byte-buffer.js +1 -1
- package/dist/utils/categorizer.js +1 -1
- package/dist/utils/clone.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/cosmetic-rule-separator.js +1 -1
- package/dist/utils/deep-freeze.js +1 -1
- package/dist/utils/domain.js +1 -1
- package/dist/utils/error.js +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/input-byte-buffer.js +1 -1
- package/dist/utils/is-chromium.js +1 -1
- package/dist/utils/logical-expression.js +1 -1
- package/dist/utils/multi-value-map.js +1 -1
- package/dist/utils/noop-modifier.js +29 -0
- package/dist/utils/output-byte-buffer.js +1 -1
- package/dist/utils/position-provider.js +1 -1
- package/dist/utils/quotes.js +1 -1
- package/dist/utils/regexp.js +1 -1
- package/dist/utils/string.js +1 -1
- package/dist/utils/text-decoder-polyfill.js +1 -1
- package/dist/utils/text-encoder-polyfill.js +1 -1
- package/dist/utils/type-guards.js +1 -1
- package/dist/validator/constants.js +3 -13
- package/dist/validator/helpers.js +2 -13
- package/dist/validator/index.js +44 -48
- package/dist/validator/value.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
package/dist/serializer/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v3.
|
|
2
|
+
* AGTree v3.4.0 (build date: Fri, 28 Nov 2025 09:46:33 GMT)
|
|
3
3
|
* (c) 2025 Adguard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @file Provides common compatibility table methods.
|
|
3
3
|
*/
|
|
4
4
|
import { type BaseCompatibilityDataSchema } from './schemas/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { type AnyPlatform, type SpecificPlatform } from './platforms.js';
|
|
6
6
|
import { type CompatibilityTable } from './types.js';
|
|
7
|
-
import {
|
|
7
|
+
import { type AdblockProduct } from '../utils/adblockers.js';
|
|
8
8
|
/**
|
|
9
9
|
* Lists all supported entity records by a product.
|
|
10
10
|
*
|
|
@@ -18,14 +18,14 @@ export type ProductRecords<T> = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Defines a compatibility table row by product.
|
|
20
20
|
*
|
|
21
|
-
* Keys are Adblock
|
|
21
|
+
* Keys are Adblock products, values are product records.
|
|
22
22
|
*
|
|
23
23
|
* @template T Compatibility data schema.
|
|
24
24
|
*/
|
|
25
25
|
export type RowByProduct<T> = {
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
26
|
+
[AdblockProduct.Adg]: ProductRecords<T>;
|
|
27
|
+
[AdblockProduct.Ubo]: ProductRecords<T>;
|
|
28
|
+
[AdblockProduct.Abp]: ProductRecords<T>;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Defines multiple compatibility table rows by product.
|
|
@@ -100,7 +100,7 @@ export declare abstract class CompatibilityTableBase<T extends BaseCompatibility
|
|
|
100
100
|
*
|
|
101
101
|
* @returns True if the compatibility data exists, false otherwise.
|
|
102
102
|
*/
|
|
103
|
-
exists(name: string, platform:
|
|
103
|
+
exists(name: string, platform: AnyPlatform): boolean;
|
|
104
104
|
/**
|
|
105
105
|
* Returns a compatibility data by name and specific platform.
|
|
106
106
|
*
|
|
@@ -121,7 +121,7 @@ export declare abstract class CompatibilityTableBase<T extends BaseCompatibility
|
|
|
121
121
|
*
|
|
122
122
|
* @note Platform enum values can be converted to string names using {@link getSpecificPlatformName} on demand.
|
|
123
123
|
*/
|
|
124
|
-
getMultiple(name: string, platform:
|
|
124
|
+
getMultiple(name: string, platform: AnyPlatform): SinglePlatformRecords<T> | null;
|
|
125
125
|
/**
|
|
126
126
|
* Returns all compatibility data records for the specified platform.
|
|
127
127
|
*
|
|
@@ -129,16 +129,16 @@ export declare abstract class CompatibilityTableBase<T extends BaseCompatibility
|
|
|
129
129
|
*
|
|
130
130
|
* @returns Array of multiple records grouped by platforms.
|
|
131
131
|
*/
|
|
132
|
-
getAllMultiple(platform:
|
|
132
|
+
getAllMultiple(platform: AnyPlatform): SinglePlatformRecords<T>[];
|
|
133
133
|
/**
|
|
134
134
|
* Returns the first compatibility data record for name and specified platform.
|
|
135
135
|
*
|
|
136
136
|
* @param name Compatibility data name.
|
|
137
|
-
* @param platform Specific or
|
|
137
|
+
* @param platform Specific, generic, or combined platform.
|
|
138
138
|
*
|
|
139
139
|
* @returns First found compatibility data record or `null` if not found.
|
|
140
140
|
*/
|
|
141
|
-
getFirst(name: string, platform:
|
|
141
|
+
getFirst(name: string, platform: AnyPlatform): T | null;
|
|
142
142
|
/**
|
|
143
143
|
* Returns all compatibility data records for the specified name.
|
|
144
144
|
*
|
|
@@ -7,7 +7,8 @@ export { scriptletsCompatibilityTable } from './scriptlets.js';
|
|
|
7
7
|
export * from './types.js';
|
|
8
8
|
export * from './platforms.js';
|
|
9
9
|
export type { ProductRecords, RowByProduct, RowsByProduct, } from './base.js';
|
|
10
|
-
export { parseRawPlatforms, stringifyPlatforms
|
|
11
|
-
export { isGenericPlatform, getPlatformId, getSpecificPlatformName, getHumanReadablePlatformName, } from './utils/platform-helpers.js';
|
|
10
|
+
export { parseRawPlatforms, stringifyPlatforms, PLATFORM_NEGATION, PLATFORM_SEPARATOR, } from './schemas/index.js';
|
|
11
|
+
export { isGenericPlatform, hasPlatformMultipleProducts, getProductGenericPlatforms, getProductSpecificPlatforms, platformToAdblockProduct, getPlatformsByProduct, getPlatformId, getSpecificPlatformName, getHumanReadablePlatformName, getAllPlatformNames, } from './utils/platform-helpers.js';
|
|
12
|
+
export type { PlatformsByProduct } from './utils/platform-helpers.js';
|
|
12
13
|
export { ResourceType, } from './schemas/resource-type.js';
|
|
13
14
|
export { getResourceTypeModifier, isValidResourceType, } from './utils/resource-type-helpers.js';
|
|
@@ -5,46 +5,80 @@
|
|
|
5
5
|
* while generic platforms are groups of specific platforms
|
|
6
6
|
* (e.g. AdGuard for any OS, AdGuard for any Chromium-based extension, etc.).
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Unique symbol to brand SpecificPlatform type.
|
|
10
|
+
*/
|
|
11
|
+
declare const SpecificPlatformBrand: unique symbol;
|
|
12
|
+
/**
|
|
13
|
+
* Unique symbol to brand GenericPlatform type.
|
|
14
|
+
*/
|
|
15
|
+
declare const GenericPlatformBrand: unique symbol;
|
|
16
|
+
/**
|
|
17
|
+
* Branded type for specific platform values.
|
|
18
|
+
*/
|
|
19
|
+
export type SpecificPlatform = number & {
|
|
20
|
+
readonly [SpecificPlatformBrand]: true;
|
|
21
|
+
};
|
|
8
22
|
/**
|
|
9
23
|
* List of specific platforms.
|
|
10
24
|
*/
|
|
11
25
|
export declare const SpecificPlatform: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
AdgOsWindows: SpecificPlatform;
|
|
27
|
+
AdgOsMac: SpecificPlatform;
|
|
28
|
+
AdgOsAndroid: SpecificPlatform;
|
|
29
|
+
AdgExtChrome: SpecificPlatform;
|
|
30
|
+
AdgExtOpera: SpecificPlatform;
|
|
31
|
+
AdgExtEdge: SpecificPlatform;
|
|
32
|
+
AdgExtFirefox: SpecificPlatform;
|
|
33
|
+
AdgCbAndroid: SpecificPlatform;
|
|
34
|
+
AdgCbIos: SpecificPlatform;
|
|
35
|
+
AdgCbSafari: SpecificPlatform;
|
|
36
|
+
UboExtChrome: SpecificPlatform;
|
|
37
|
+
UboExtOpera: SpecificPlatform;
|
|
38
|
+
UboExtEdge: SpecificPlatform;
|
|
39
|
+
UboExtFirefox: SpecificPlatform;
|
|
40
|
+
AbpExtChrome: SpecificPlatform;
|
|
41
|
+
AbpExtOpera: SpecificPlatform;
|
|
42
|
+
AbpExtEdge: SpecificPlatform;
|
|
43
|
+
AbpExtFirefox: SpecificPlatform;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Branded type for generic platform values.
|
|
47
|
+
*/
|
|
48
|
+
export type GenericPlatform = number & {
|
|
49
|
+
readonly [GenericPlatformBrand]: true;
|
|
30
50
|
};
|
|
31
|
-
export type SpecificPlatform = typeof SpecificPlatform[keyof typeof SpecificPlatform];
|
|
32
51
|
/**
|
|
33
52
|
* List of generic platforms (combinations of specific platforms).
|
|
34
53
|
*/
|
|
35
54
|
export declare const GenericPlatform: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
AdgOsAny: GenericPlatform;
|
|
56
|
+
AdgSafariAny: GenericPlatform;
|
|
57
|
+
AdgExtChromium: GenericPlatform;
|
|
58
|
+
AdgExtAny: GenericPlatform;
|
|
59
|
+
AdgAny: GenericPlatform;
|
|
60
|
+
UboExtChromium: GenericPlatform;
|
|
61
|
+
UboExtAny: GenericPlatform;
|
|
62
|
+
UboAny: GenericPlatform;
|
|
63
|
+
AbpExtChromium: GenericPlatform;
|
|
64
|
+
AbpExtAny: GenericPlatform;
|
|
65
|
+
AbpAny: GenericPlatform;
|
|
66
|
+
Any: GenericPlatform;
|
|
48
67
|
};
|
|
49
|
-
|
|
50
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Represents any platform: specific, generic, or a combination of platforms.
|
|
70
|
+
*
|
|
71
|
+
* The `number` type is included to support combined platforms created via bitwise OR operations.
|
|
72
|
+
* For example: `GenericPlatform.AdgAny | GenericPlatform.UboAny` results in a `number` at the type level.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // Single platform
|
|
77
|
+
* const singlePlatform: AnyPlatform = SpecificPlatform.AdgOsWindows;
|
|
78
|
+
*
|
|
79
|
+
* // Combined platforms (result is number)
|
|
80
|
+
* const combinedPlatforms: AnyPlatform = GenericPlatform.AdgAny | GenericPlatform.UboAny;
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export type AnyPlatform = SpecificPlatform | GenericPlatform | number;
|
|
84
|
+
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { CompatibilityTableBase } from './base.js';
|
|
5
5
|
import { type RedirectDataSchema } from './schemas/index.js';
|
|
6
6
|
import { type CompatibilityTable } from './types.js';
|
|
7
|
-
import { type
|
|
7
|
+
import { type AnyPlatform } from './platforms.js';
|
|
8
8
|
/**
|
|
9
9
|
* Compatibility table for redirects.
|
|
10
10
|
*/
|
|
@@ -20,11 +20,11 @@ declare class RedirectsCompatibilityTable extends CompatibilityTableBase<Redirec
|
|
|
20
20
|
* based on the `resourceTypes` field.
|
|
21
21
|
*
|
|
22
22
|
* @param redirect Redirect name or redirect data.
|
|
23
|
-
* @param platform Platform to get the modifiers for.
|
|
23
|
+
* @param platform Platform to get the modifiers for (can be specific, generic, or combined platforms).
|
|
24
24
|
*
|
|
25
25
|
* @returns Set of resource type modifiers or an empty set if the redirect is not found or has no resource types.
|
|
26
26
|
*/
|
|
27
|
-
getResourceTypeModifiers(redirect: string | RedirectDataSchema, platform:
|
|
27
|
+
getResourceTypeModifiers(redirect: string | RedirectDataSchema, platform: AnyPlatform): Set<string>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Compatibility table instance for redirects.
|
|
@@ -117,7 +117,7 @@ export declare const baseRefineLogic: (data: zod.infer<typeof baseCompatibilityD
|
|
|
117
117
|
*
|
|
118
118
|
* @returns Base file schema.
|
|
119
119
|
*/
|
|
120
|
-
export declare const baseFileSchema: <T extends BaseCompatibilityDataSchema>(dataSchema: zod.ZodType<T>) => zod.ZodPipeline<zod.ZodEffects<zod.ZodRecord<zod.ZodAny, zod.ZodAny>, Record<any, any>, Record<any, any>>, zod.ZodRecord<zod.ZodEffects<zod.ZodString, number, string>, zod.ZodType<T, zod.ZodTypeDef, T>>>;
|
|
120
|
+
export declare const baseFileSchema: <T extends BaseCompatibilityDataSchema>(dataSchema: zod.ZodType<T>) => zod.ZodPipeline<zod.ZodEffects<zod.ZodRecord<zod.ZodAny, zod.ZodAny>, Record<any, any>, Record<any, any>>, zod.ZodRecord<zod.ZodEffects<zod.ZodString, number | import("../index.js").SpecificPlatform | import("../index.js").GenericPlatform, string>, zod.ZodType<T, zod.ZodTypeDef, T>>>;
|
|
121
121
|
/**
|
|
122
122
|
* Type of the base file schema.
|
|
123
123
|
*/
|
|
@@ -2,25 +2,36 @@
|
|
|
2
2
|
* @file Platform schema.
|
|
3
3
|
*/
|
|
4
4
|
import zod from 'zod';
|
|
5
|
+
import { type AnyPlatform } from '../platforms.js';
|
|
6
|
+
/**
|
|
7
|
+
* Platform separator, e.g. 'adg_os_any|adg_safari_any' means any AdGuard OS platform and
|
|
8
|
+
* any AdGuard Safari content blocker platform.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PLATFORM_SEPARATOR = "|";
|
|
11
|
+
/**
|
|
12
|
+
* Platform negation character, e.g. 'adg_any|~adg_safari_any' means any AdGuard product except
|
|
13
|
+
* Safari content blockers.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PLATFORM_NEGATION = "~";
|
|
5
16
|
/**
|
|
6
17
|
* Parses a raw platform string into a platform bitmask.
|
|
7
18
|
*
|
|
8
19
|
* @param rawPlatforms Raw platform string, e.g. 'adg_safari_any|adg_os_any'.
|
|
9
20
|
*
|
|
10
|
-
* @returns Platform bitmask.
|
|
21
|
+
* @returns Platform bitmask (can be specific, generic, or combined platforms).
|
|
11
22
|
*/
|
|
12
|
-
export declare const parseRawPlatforms: (rawPlatforms: string) =>
|
|
23
|
+
export declare const parseRawPlatforms: (rawPlatforms: string) => AnyPlatform;
|
|
13
24
|
/**
|
|
14
25
|
* Converts a platform bitmask back to a string representation.
|
|
15
26
|
* Prefers generic platforms over specific platforms where possible.
|
|
16
27
|
*
|
|
17
|
-
* @param bitmask Platform bitmask.
|
|
28
|
+
* @param bitmask Platform bitmask (can be specific, generic, or combined platforms).
|
|
18
29
|
*
|
|
19
30
|
* @returns Platform string, e.g. 'adg_safari_any|adg_os_any' or 'adg_os_windows|adg_ext_chrome'.
|
|
20
31
|
* @throws Error if the bitmask is 0 or contains unknown platforms.
|
|
21
32
|
*/
|
|
22
|
-
export declare const stringifyPlatforms: (bitmask:
|
|
33
|
+
export declare const stringifyPlatforms: (bitmask: AnyPlatform) => string;
|
|
23
34
|
/**
|
|
24
35
|
* Platform schema.
|
|
25
36
|
*/
|
|
26
|
-
export declare const platformSchema: zod.ZodEffects<zod.ZodString, number, string>;
|
|
37
|
+
export declare const platformSchema: zod.ZodEffects<zod.ZodString, number | import("../index.js").SpecificPlatform | import("../index.js").GenericPlatform, string>;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @file Provides platform mapping and helper functions.
|
|
3
3
|
*/
|
|
4
4
|
import { type AnyPlatform, GenericPlatform, SpecificPlatform } from '../platforms.js';
|
|
5
|
+
import { AdblockProduct } from '../../utils/adblockers.js';
|
|
6
|
+
import { type ReadonlyRecord } from '../../utils/types.js';
|
|
5
7
|
/**
|
|
6
8
|
* Map of specific platforms string names to their corresponding enum values.
|
|
7
9
|
*/
|
|
@@ -17,13 +19,89 @@ export declare const SPECIFIC_PLATFORM_MAP_REVERSE: Map<SpecificPlatform, string
|
|
|
17
19
|
*/
|
|
18
20
|
export declare const GENERIC_PLATFORM_MAP: Map<string, GenericPlatform>;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* Initializes and returns the product generic platforms map.
|
|
23
|
+
* Filters all generic platforms by product prefix and sorts by specificity (fewer bits = more specific).
|
|
24
|
+
*
|
|
25
|
+
* @returns Map of products to their generic platforms, ordered from most to least specific.
|
|
26
|
+
*/
|
|
27
|
+
export declare const getProductGenericPlatforms: () => ReadonlyRecord<AdblockProduct, readonly GenericPlatform[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Check if the platform is a generic platform (or a combination of platforms).
|
|
30
|
+
*
|
|
31
|
+
* @param platform Platform to check.
|
|
32
|
+
*
|
|
33
|
+
* @returns True if the platform is a generic platform or combined platforms, false if it's a specific platform.
|
|
34
|
+
*/
|
|
35
|
+
export declare const isGenericPlatform: (platform: AnyPlatform) => platform is GenericPlatform | number;
|
|
36
|
+
/**
|
|
37
|
+
* Check if the platform has multiple products specified.
|
|
38
|
+
* Multiple products means at least 2 of: AdgAny, AbpAny, UboAny.
|
|
21
39
|
*
|
|
22
40
|
* @param platform Platform to check.
|
|
23
41
|
*
|
|
24
|
-
* @returns True if
|
|
42
|
+
* @returns True if at least 2 products are specified, false otherwise.
|
|
43
|
+
*/
|
|
44
|
+
export declare const hasPlatformMultipleProducts: (platform: AnyPlatform) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Converts a platform to its corresponding adblock products.
|
|
47
|
+
*
|
|
48
|
+
* Note: This conversion is less specific than the platform itself, as it only returns
|
|
49
|
+
* which products (AdGuard/uBlock/Abp) are present, dropping specific platform information
|
|
50
|
+
* (e.g., Windows vs Chrome extension).
|
|
51
|
+
*
|
|
52
|
+
* @param platform Platform to convert.
|
|
53
|
+
*
|
|
54
|
+
* @returns Array of AdblockProduct values:
|
|
55
|
+
* - Empty array `[]` if platform is 0 or no products are found
|
|
56
|
+
* - Array of specific products based on which products are present
|
|
57
|
+
* (e.g., `['AdGuard', 'UblockOrigin']` if both AdGuard and uBlock Origin are specified)
|
|
58
|
+
* - `['AdGuard', 'UblockOrigin', 'AdblockPlus']` for GenericPlatform.Any
|
|
59
|
+
*/
|
|
60
|
+
export declare const platformToAdblockProduct: (platform: AnyPlatform) => AdblockProduct[];
|
|
61
|
+
/**
|
|
62
|
+
* Platforms grouped by product.
|
|
63
|
+
* Maps each product to an array of its platform values.
|
|
64
|
+
*/
|
|
65
|
+
export type PlatformsByProduct = Partial<Record<AdblockProduct, AnyPlatform[]>>;
|
|
66
|
+
/**
|
|
67
|
+
* Splits a platform by products, returning a record mapping each product to its platforms.
|
|
68
|
+
* This is useful for iterating over each product separately when validating or processing.
|
|
69
|
+
*
|
|
70
|
+
* The function optimizes the platform representation by combining specific platforms
|
|
71
|
+
* into generic ones when possible, returning the minimal set needed.
|
|
72
|
+
*
|
|
73
|
+
* @param platform Platform to split (can be single or multi-product).
|
|
74
|
+
*
|
|
75
|
+
* @returns Record mapping products to optimized platform arrays:
|
|
76
|
+
* - Empty object `{}` if platform is 0 or no products are found
|
|
77
|
+
* - Object with single product key for single-product platforms
|
|
78
|
+
* - Object with multiple product keys for multi-product platforms
|
|
79
|
+
* - Each array contains the minimal representation using generic platforms where possible
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* // Multi-product platform
|
|
84
|
+
* const platforms = getPlatformsByProduct(GenericPlatform.AdgAny | GenericPlatform.UboAny);
|
|
85
|
+
* // Returns: {
|
|
86
|
+
* // 'AdGuard': [GenericPlatform.AdgAny],
|
|
87
|
+
* // 'UblockOrigin': [GenericPlatform.UboAny]
|
|
88
|
+
* // }
|
|
89
|
+
*
|
|
90
|
+
* // Mixed specific and generic
|
|
91
|
+
* const mixed = SpecificPlatform.AdgExtChrome | SpecificPlatform.AdgExtFirefox | SpecificPlatform.AdgOsWindows;
|
|
92
|
+
* const result = getPlatformsByProduct(mixed);
|
|
93
|
+
* // Might return: { 'AdGuard': [GenericPlatform.AdgExtChromium, SpecificPlatform.AdgOsWindows] }
|
|
94
|
+
*
|
|
95
|
+
* // Iterate and validate for each product
|
|
96
|
+
* for (const [product, platformList] of Object.entries(platforms)) {
|
|
97
|
+
* for (const p of platformList) {
|
|
98
|
+
* const result = modifierValidator.validate(p, modifier);
|
|
99
|
+
* console.log(`${product}: ${result.valid}`);
|
|
100
|
+
* }
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
25
103
|
*/
|
|
26
|
-
export declare const
|
|
104
|
+
export declare const getPlatformsByProduct: (platform: AnyPlatform) => PlatformsByProduct;
|
|
27
105
|
/**
|
|
28
106
|
* Returns the platform enum value for the given platform string name.
|
|
29
107
|
*
|
|
@@ -52,3 +130,34 @@ export declare const getSpecificPlatformName: (platform: SpecificPlatform) => st
|
|
|
52
130
|
* @throws Error if the platform is unknown.
|
|
53
131
|
*/
|
|
54
132
|
export declare const getHumanReadablePlatformName: (platform: AnyPlatform) => string;
|
|
133
|
+
/**
|
|
134
|
+
* Gets all specific platforms for a given AdblockProduct.
|
|
135
|
+
* Results are cached after the first call.
|
|
136
|
+
*
|
|
137
|
+
* @param product AdblockProduct to get specific platforms for.
|
|
138
|
+
*
|
|
139
|
+
* @returns Array of all specific platforms for the given product.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* const adgPlatforms = getProductSpecificPlatforms(AdblockProduct.Adg);
|
|
144
|
+
* // Returns: [AdgOsWindows, AdgOsMac, AdgOsAndroid, AdgExtChrome, ...]
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
export declare const getProductSpecificPlatforms: (product: AdblockProduct) => readonly SpecificPlatform[];
|
|
148
|
+
/**
|
|
149
|
+
* Gets all available platform names from the platform maps.
|
|
150
|
+
*
|
|
151
|
+
* @returns Object containing arrays of all specific and generic platform names.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* const { specificPlatformNames, genericPlatformNames } = getAllPlatformNames();
|
|
156
|
+
* // specificPlatformNames: ['adg_os_windows', 'adg_os_mac', 'adg_os_android', ...]
|
|
157
|
+
* // genericPlatformNames: ['adg_os_any', 'adg_safari_any', 'adg_ext_chromium', ...]
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export declare const getAllPlatformNames: () => {
|
|
161
|
+
specificPlatformNames: readonly string[];
|
|
162
|
+
genericPlatformNames: readonly string[];
|
|
163
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AnyPlatform } from '../platforms.js';
|
|
2
2
|
import { ResourceType } from '../schemas/resource-type.js';
|
|
3
3
|
/**
|
|
4
4
|
* Gets the adblock modifier name for the given resource type.
|
|
5
5
|
*
|
|
6
6
|
* @param resourceType Resource type to get the modifier name for.
|
|
7
|
-
* @param platform Platform to get the modifier for.
|
|
7
|
+
* @param platform Platform to get the modifier for (can be specific, generic, or combined platforms).
|
|
8
8
|
*
|
|
9
9
|
* @returns A string containing the adblock modifier name for the given resource type
|
|
10
10
|
* or `null` if the modifier could not be found.
|
|
11
11
|
*/
|
|
12
|
-
export declare const getResourceTypeModifier: (resourceType: ResourceType, platform:
|
|
12
|
+
export declare const getResourceTypeModifier: (resourceType: ResourceType, platform: AnyPlatform) => string | null;
|
|
13
13
|
/**
|
|
14
14
|
* Checks if the given resource type is valid.
|
|
15
15
|
*
|
package/dist/types/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export { modifierValidator } from './validator/index.js';
|
|
|
37
37
|
export * from './converter/index.js';
|
|
38
38
|
export { ADG_SCRIPTLET_MASK, AGLINT_COMMAND_PREFIX, COMMA_DOMAIN_LIST_SEPARATOR, NEGATION_MARKER, HINT_MARKER, IF, INCLUDE, MODIFIERS_SEPARATOR, MODIFIER_ASSIGN_OPERATOR, PIPE_MODIFIER_SEPARATOR, NETWORK_RULE_EXCEPTION_MARKER, NETWORK_RULE_SEPARATOR, PREPROCESSOR_MARKER, SAFARI_CB_AFFINITY, UBO_SCRIPTLET_MASK, } from './utils/constants.js';
|
|
39
39
|
export { BINARY_SCHEMA_VERSION } from './utils/binary-schema-version.js';
|
|
40
|
-
export { AdblockSyntax } from './utils/adblockers.js';
|
|
40
|
+
export { AdblockSyntax, AdblockProduct } from './utils/adblockers.js';
|
|
41
41
|
export { type CosmeticRuleSeparatorFinderResult, CosmeticRuleSeparatorUtils } from './utils/cosmetic-rule-separator.js';
|
|
42
42
|
export { DomainUtils } from './utils/domain.js';
|
|
43
43
|
export { type VariableTable, LogicalExpressionUtils } from './utils/logical-expression.js';
|
|
@@ -51,6 +51,6 @@ export { encodeIntoPolyfill, type TextEncoderPolyfillResult } from './utils/text
|
|
|
51
51
|
export { decodeTextPolyfill } from './utils/text-decoder-polyfill.js';
|
|
52
52
|
export { RuleCategorizer } from './utils/categorizer.js';
|
|
53
53
|
export { EXT_CSS_PSEUDO_CLASSES, EXT_CSS_LEGACY_ATTRIBUTES, FORBIDDEN_CSS_FUNCTIONS } from './converter/data/css.js';
|
|
54
|
-
export { GenericPlatform, SpecificPlatform, modifiersCompatibilityTable, redirectsCompatibilityTable, scriptletsCompatibilityTable, parseRawPlatforms, type CompatibilityTable, type CompatibilityTableRow, type ProductRecords, type RowByProduct, type RowsByProduct, isGenericPlatform, getPlatformId, getSpecificPlatformName, ResourceType, getResourceTypeModifier, isValidResourceType, } from './compatibility-tables/index.js';
|
|
54
|
+
export { GenericPlatform, SpecificPlatform, modifiersCompatibilityTable, redirectsCompatibilityTable, scriptletsCompatibilityTable, parseRawPlatforms, type CompatibilityTable, type CompatibilityTableRow, type ProductRecords, type RowByProduct, type RowsByProduct, isGenericPlatform, getPlatformId, getSpecificPlatformName, hasPlatformMultipleProducts, getProductGenericPlatforms, getProductSpecificPlatforms, platformToAdblockProduct, getPlatformsByProduct, getHumanReadablePlatformName, getAllPlatformNames, ResourceType, getResourceTypeModifier, isValidResourceType, stringifyPlatforms, type PlatformsByProduct, type AnyPlatform, PLATFORM_NEGATION, PLATFORM_SEPARATOR, } from './compatibility-tables/index.js';
|
|
55
55
|
export { AGTREE_VERSION } from './version.js';
|
|
56
56
|
export { getSyntaxSerializationMap } from './marshalling-utils/syntax-serialization-map.js';
|