@fluid-experimental/property-changeset 0.52.1 → 0.54.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/helpers/typeidHelper.d.ts +2 -2
- package/dist/helpers/typeidHelper.d.ts.map +1 -1
- package/dist/helpers/typeidHelper.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +237 -207
- package/dist/utils.d.ts +11 -8
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +7 -9
- package/dist/utils.js.map +1 -1
- package/lib/helpers/typeidHelper.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/utils.js +7 -9
- package/lib/utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -53,7 +53,7 @@ export declare namespace TypeIdHelper {
|
|
|
53
53
|
* @param in_typeid - The typeid to process
|
|
54
54
|
* @returns Returns the typeid without context, the context and if we have an enum type
|
|
55
55
|
*/
|
|
56
|
-
function extractContext(in_typeid: string): ExtractedContext;
|
|
56
|
+
function extractContext(in_typeid: string | undefined): ExtractedContext;
|
|
57
57
|
/**
|
|
58
58
|
* Creates a collection typeid string from the
|
|
59
59
|
* typeid and the context.
|
|
@@ -71,7 +71,7 @@ export declare namespace TypeIdHelper {
|
|
|
71
71
|
* @param in_typeid - The typeid to check
|
|
72
72
|
* @returns Is this a reference property typeid?
|
|
73
73
|
*/
|
|
74
|
-
function isReferenceTypeId(in_typeid: string): boolean;
|
|
74
|
+
function isReferenceTypeId(in_typeid: string | undefined): boolean;
|
|
75
75
|
/**
|
|
76
76
|
* Returns the type of the properties a reference points to
|
|
77
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeidHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/typeidHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;A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K,cAAc,IAAI,SAAS,KAAK,aAAa,EAAE;YACjE,OAAO,IAAI,CAAC;SACf;QAED,IAAI,SAAS,KAAK,cAAc,EAAE;YAC9B,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,OAAO,GAAG,4BAAW,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;QAEjD,6DAA6D;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE;gBACpD,OAAO,IAAI,CAAC;aACf;SACJ;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAtCe,+BAAkB,qBAsCjC,CAAA;IAED;;;;OAIG;IACH,SAAgB,mBAAmB;QAC/B,OAAO,+BAAkB,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;IAFe,gCAAmB,sBAElC,CAAA;IAED;;;;OAIG;IACH,SAAgB,kBAAkB;QAC9B,OAAO,+BAAkB,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAFe,+BAAkB,qBAEjC,CAAA;AACL,CAAC,EA/PgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA+P5B;AAAA,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions to work with typeid strings\n */\n\nimport { TemplateSchema as templateSchemaJson, NativeTypes } from \"../templateSchema\";\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nconst { MSG } = constants;\n\nexport declare interface ExtractedVersion {\n version: string;\n typeidWithoutVersion: string;\n}\n\nexport declare interface ExtractedContext {\n typeid: string;\n context: string;\n isEnum: boolean;\n}\n\n/**\n * Helper for Type IDs\n * @public\n * @description Helper functions to work with typeid strings\n */\nexport namespace TypeIdHelper {\n /**\n * Checks whether the given type is a primitive type.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a base type?\n */\n export function isPrimitiveType(in_typeid: string): boolean {\n const primitiveTypes = templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n\n if (in_typeid === undefined || in_typeid === \"\") {\n return false;\n }\n\n return in_typeid.substr(0, 5) === \"enum<\" ||\n in_typeid.substr(0, 10) === \"Reference<\" ||\n primitiveTypes.indexOf(in_typeid) >= 0;\n }\n\n /**\n * Checks whether the given type is a template typeid.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a base template typeid?\n */\n export function isTemplateTypeid(in_typeid: string): boolean {\n return in_typeid.indexOf(\":\") !== -1;\n }\n\n /**\n * Checks whether the given type is a reserved type.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a reserved type?\n */\n export function isReservedType(in_typeid: string): boolean {\n const reservedTypes = templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n return reservedTypes.indexOf(in_typeid) >= 0;\n }\n\n /**\n * Extract the version number from the given typeid\n * @param in_typeid The typeid to check against\n * @returns Extracted version\n */\n export function extractVersion(in_typeid): ExtractedVersion {\n if (!in_typeid) {\n throw new Error(MSG.TYPEID_NOT_DEFINED);\n }\n const splitTypeId = in_typeid.split(\"-\");\n\n return {\n version: splitTypeId[1],\n typeidWithoutVersion: splitTypeId[0]\n };\n }\n\n /**\n * Extracts the context from a typeid\n *\n * @param in_typeid - The typeid to process\n * @returns Returns the typeid without context, the context and if we have an enum type\n */\n export function extractContext(in_typeid: string): ExtractedContext {\n const bracketIndex = in_typeid.indexOf(\"<\");\n if (bracketIndex !== -1 &&\n in_typeid[in_typeid.length - 1] === \">\") {\n let typeid = in_typeid.substr(bracketIndex + 1, in_typeid.length - bracketIndex - 2);\n let context = in_typeid.substr(0, bracketIndex);\n\n // Special case to handle collections without a typeid (e.g. \"map<>\", which should\n // be able to support all property types\n if (typeid === \"\") {\n typeid = context !== \"set\" ? \"BaseProperty\" : \"NamedProperty\";\n }\n\n // Special case to handle enums (e.g. array<enum<myType>>)\n let isEnum = false;\n if (context === \"enum\" || typeid.substr(0, 5) === \"enum<\") {\n isEnum = true;\n if (context === \"enum\") {\n context = \"single\";\n } else {\n // remove the `enum<...>` tag to get the raw typeid\n typeid = typeid.substr(5, typeid.length - 6);\n }\n }\n if (context === \"Reference\") {\n typeid = `Reference<${typeid}>`;\n context = \"single\";\n }\n\n return {\n typeid,\n context,\n isEnum\n };\n } else {\n return {\n typeid: in_typeid,\n context: \"single\",\n isEnum: false\n };\n }\n }\n\n /**\n * Creates a collection typeid string from the\n * typeid and the context.\n *\n * @param in_typeid - the typeid in the collection\n * @param in_context - the context\n * @param in_enum - set to true, if the type should get an enum tag\n *\n * @returns The combined typeid string\n */\n export function createSerializationTypeId(in_typeid: string, in_context: string, in_enum: boolean): string { // in_enum\n if (in_typeid === \"BaseProperty\") {\n // Special case for BaseProperties. These get represented as a collection\n // typeid without a child typeid. E.g. map<> instead of map<BaseProperty>\n return `${in_context}<>`;\n } else {\n if (in_enum) {\n if (in_context === \"\" || in_context === \"single\") {\n return `enum<${in_typeid}>`;\n } else {\n return `${in_context}<enum<${in_typeid}>>`;\n }\n } else {\n return `${in_context}<${in_typeid}>`;\n }\n }\n }\n\n /**\n * Checks, whether the supplied typeid is a reference property type id\n *\n * @param in_typeid - The typeid to check\n * @returns Is this a reference property typeid?\n */\n export function isReferenceTypeId(in_typeid: string): boolean { // in_enum\n return in_typeid === \"Reference\" ||\n (in_typeid.substr(0, 10) === \"Reference<\" && in_typeid.substr(-1) === \">\");\n }\n\n /**\n * Returns the type of the properties a reference points to\n *\n * @param in_typeid - The typeid to process\n * @return The type of the referenced property\n */\n export function extractReferenceTargetTypeIdFromReference(in_typeid: string): string { // in_enum\n if (in_typeid.substr(0, 10) === \"Reference<\") {\n // Extract the type from the TypeID\n return in_typeid.substr(10, in_typeid.length - 11);\n } else {\n // This is a typeless reference, we allow all types\n return \"BaseProperty\";\n }\n }\n\n /**\n * Checks whether the given type is a template typeid.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a base template typeid?\n */\n export function isSchemaTypeid(in_typeid: string): boolean {\n return typeof in_typeid === \"string\" && (in_typeid.indexOf(\":\") !== -1);\n }\n\n /**\n * Extracts referenced typeid from input typeid\n *\n * @param in_typeid typeid\n *\n * @return referenced typeid or in_param if it is not a reference\n */\n export function extractTypeId(in_typeid): string {\n const matches = in_typeid.match(/\\<(.*?)\\>/); // eslint-disable-line\n if (matches !== null && matches.length > 0) {\n return matches[0].replace(/[\\<\\>]/gi, \"\"); // eslint-disable-line\n } else {\n return in_typeid;\n }\n }\n\n\n /**\n * Check wether the in_typeid inherits from the in_baseTypeid\n *\n * Note: By default, this also returns true if in_typeid === in_baseTypeid.\n *\n * @param in_typeid - Typeid for which we want to check, whethwe in_baseTypeid is a parent\n * @param in_baseTypeid - The base typeId to check for\n * @throws if in_typeid or in_baseTypeid are not native typeid\n * @returns True if in_baseTypeid is a parent of in_typeid\n */\n export function nativeInheritsFrom(in_typeid: string, in_baseTypeid: string): boolean {\n if (!in_typeid || !in_baseTypeid) {\n throw new Error(MSG.TYPEID_NOT_DEFINED);\n }\n\n if (in_typeid.substr(0, 10) === \"Reference<\") {\n in_typeid = \"Reference\";\n }\n\n if (in_baseTypeid.substr(0, 10) === \"Reference<\") {\n in_baseTypeid = \"Reference\";\n }\n\n if (!NativeTypes[in_typeid]) {\n throw new Error(MSG.TYPEID_NOT_NATIVE + in_typeid);\n }\n\n if (!NativeTypes[in_baseTypeid]) {\n throw new Error(MSG.TYPEID_NOT_NATIVE + in_baseTypeid);\n }\n\n if (in_baseTypeid === \"BaseProperty\" || in_typeid === in_baseTypeid) {\n return true;\n }\n\n if (in_typeid === \"BaseProperty\") {\n return false;\n }\n\n let parents = NativeTypes[in_typeid][\"inherits\"];\n\n // recursively call the function for the parent of the typeid\n for (let i = 0; i < parents.length; i++) {\n if (this.nativeInheritsFrom(parents[i], in_baseTypeid)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * return all primitive typeIds\n *\n * @returns return a list of primitiveTypeIds\n */\n export function getPrimitiveTypeIds(): string[] {\n return templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n }\n\n /**\n * return all reserved typeIds\n *\n * @returns return a list of reservedTypeIds\n */\n export function getReservedTypeIds(): string[] {\n return templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"typeidHelper.js","sourceRoot":"","sources":["../../src/helpers/typeidHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;AAEH,sDAAsF;AACtF,aAAa;AACb,yEAAgE;AAEhE,MAAM,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAa1B;;;;GAIG;AACH,IAAiB,YAAY,CA+P5B;AA/PD,WAAiB,YAAY;IACzB;;;;;OAKG;IACH,SAAgB,eAAe,CAAC,SAAiB;QAC7C,MAAM,cAAc,GAAG,+BAAkB,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;QAE/E,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE,EAAE;YAC7C,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO;YACrC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,YAAY;YACxC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAVe,4BAAe,kBAU9B,CAAA;IAED;;;;;MAKE;IACF,SAAgB,gBAAgB,CAAC,SAAiB;QAC9C,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,CAAC;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CAAC,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;IAFe,gCAAmB,sBAElC,CAAA;IAED;;;;OAIG;IACH,SAAgB,kBAAkB;QAC9B,OAAO,+BAAkB,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAFe,+BAAkB,qBAEjC,CAAA;AACL,CAAC,EA/PgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA+P5B;AAAA,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions to work with typeid strings\n */\n\nimport { TemplateSchema as templateSchemaJson, NativeTypes } from \"../templateSchema\";\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nconst { MSG } = constants;\n\nexport declare interface ExtractedVersion {\n version: string;\n typeidWithoutVersion: string;\n}\n\nexport declare interface ExtractedContext {\n typeid: string;\n context: string;\n isEnum: boolean;\n}\n\n/**\n * Helper for Type IDs\n * @public\n * @description Helper functions to work with typeid strings\n */\nexport namespace TypeIdHelper {\n /**\n * Checks whether the given type is a primitive type.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a base type?\n */\n export function isPrimitiveType(in_typeid: string): boolean {\n const primitiveTypes = templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n\n if (in_typeid === undefined || in_typeid === \"\") {\n return false;\n }\n\n return in_typeid.substr(0, 5) === \"enum<\" ||\n in_typeid.substr(0, 10) === \"Reference<\" ||\n primitiveTypes.indexOf(in_typeid) >= 0;\n }\n\n /**\n * Checks whether the given type is a template typeid.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a base template typeid?\n */\n export function isTemplateTypeid(in_typeid: string): boolean {\n return in_typeid.indexOf(\":\") !== -1;\n }\n\n /**\n * Checks whether the given type is a reserved type.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a reserved type?\n */\n export function isReservedType(in_typeid: string): boolean {\n const reservedTypes = templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n return reservedTypes.indexOf(in_typeid) >= 0;\n }\n\n /**\n * Extract the version number from the given typeid\n * @param in_typeid The typeid to check against\n * @returns Extracted version\n */\n export function extractVersion(in_typeid): ExtractedVersion {\n if (!in_typeid) {\n throw new Error(MSG.TYPEID_NOT_DEFINED);\n }\n const splitTypeId = in_typeid.split(\"-\");\n\n return {\n version: splitTypeId[1],\n typeidWithoutVersion: splitTypeId[0]\n };\n }\n\n /**\n * Extracts the context from a typeid\n *\n * @param in_typeid - The typeid to process\n * @returns Returns the typeid without context, the context and if we have an enum type\n */\n export function extractContext(in_typeid: string | undefined): ExtractedContext {\n const bracketIndex = in_typeid.indexOf(\"<\");\n if (bracketIndex !== -1 &&\n in_typeid[in_typeid.length - 1] === \">\") {\n let typeid = in_typeid.substr(bracketIndex + 1, in_typeid.length - bracketIndex - 2);\n let context = in_typeid.substr(0, bracketIndex);\n\n // Special case to handle collections without a typeid (e.g. \"map<>\", which should\n // be able to support all property types\n if (typeid === \"\") {\n typeid = context !== \"set\" ? \"BaseProperty\" : \"NamedProperty\";\n }\n\n // Special case to handle enums (e.g. array<enum<myType>>)\n let isEnum = false;\n if (context === \"enum\" || typeid.substr(0, 5) === \"enum<\") {\n isEnum = true;\n if (context === \"enum\") {\n context = \"single\";\n } else {\n // remove the `enum<...>` tag to get the raw typeid\n typeid = typeid.substr(5, typeid.length - 6);\n }\n }\n if (context === \"Reference\") {\n typeid = `Reference<${typeid}>`;\n context = \"single\";\n }\n\n return {\n typeid,\n context,\n isEnum\n };\n } else {\n return {\n typeid: in_typeid,\n context: \"single\",\n isEnum: false\n };\n }\n }\n\n /**\n * Creates a collection typeid string from the\n * typeid and the context.\n *\n * @param in_typeid - the typeid in the collection\n * @param in_context - the context\n * @param in_enum - set to true, if the type should get an enum tag\n *\n * @returns The combined typeid string\n */\n export function createSerializationTypeId(in_typeid: string, in_context: string, in_enum: boolean): string { // in_enum\n if (in_typeid === \"BaseProperty\") {\n // Special case for BaseProperties. These get represented as a collection\n // typeid without a child typeid. E.g. map<> instead of map<BaseProperty>\n return `${in_context}<>`;\n } else {\n if (in_enum) {\n if (in_context === \"\" || in_context === \"single\") {\n return `enum<${in_typeid}>`;\n } else {\n return `${in_context}<enum<${in_typeid}>>`;\n }\n } else {\n return `${in_context}<${in_typeid}>`;\n }\n }\n }\n\n /**\n * Checks, whether the supplied typeid is a reference property type id\n *\n * @param in_typeid - The typeid to check\n * @returns Is this a reference property typeid?\n */\n export function isReferenceTypeId(in_typeid: string | undefined ): boolean { // in_enum\n return in_typeid === \"Reference\" ||\n (in_typeid.substr(0, 10) === \"Reference<\" && in_typeid.substr(-1) === \">\");\n }\n\n /**\n * Returns the type of the properties a reference points to\n *\n * @param in_typeid - The typeid to process\n * @return The type of the referenced property\n */\n export function extractReferenceTargetTypeIdFromReference(in_typeid: string): string { // in_enum\n if (in_typeid.substr(0, 10) === \"Reference<\") {\n // Extract the type from the TypeID\n return in_typeid.substr(10, in_typeid.length - 11);\n } else {\n // This is a typeless reference, we allow all types\n return \"BaseProperty\";\n }\n }\n\n /**\n * Checks whether the given type is a template typeid.\n *\n * @param in_typeid - The typeid we want to check\n * @returns Is this a base template typeid?\n */\n export function isSchemaTypeid(in_typeid: string): boolean {\n return typeof in_typeid === \"string\" && (in_typeid.indexOf(\":\") !== -1);\n }\n\n /**\n * Extracts referenced typeid from input typeid\n *\n * @param in_typeid typeid\n *\n * @return referenced typeid or in_param if it is not a reference\n */\n export function extractTypeId(in_typeid): string {\n const matches = in_typeid.match(/\\<(.*?)\\>/); // eslint-disable-line\n if (matches !== null && matches.length > 0) {\n return matches[0].replace(/[\\<\\>]/gi, \"\"); // eslint-disable-line\n } else {\n return in_typeid;\n }\n }\n\n\n /**\n * Check wether the in_typeid inherits from the in_baseTypeid\n *\n * Note: By default, this also returns true if in_typeid === in_baseTypeid.\n *\n * @param in_typeid - Typeid for which we want to check, whethwe in_baseTypeid is a parent\n * @param in_baseTypeid - The base typeId to check for\n * @throws if in_typeid or in_baseTypeid are not native typeid\n * @returns True if in_baseTypeid is a parent of in_typeid\n */\n export function nativeInheritsFrom(in_typeid: string, in_baseTypeid: string): boolean {\n if (!in_typeid || !in_baseTypeid) {\n throw new Error(MSG.TYPEID_NOT_DEFINED);\n }\n\n if (in_typeid.substr(0, 10) === \"Reference<\") {\n in_typeid = \"Reference\";\n }\n\n if (in_baseTypeid.substr(0, 10) === \"Reference<\") {\n in_baseTypeid = \"Reference\";\n }\n\n if (!NativeTypes[in_typeid]) {\n throw new Error(MSG.TYPEID_NOT_NATIVE + in_typeid);\n }\n\n if (!NativeTypes[in_baseTypeid]) {\n throw new Error(MSG.TYPEID_NOT_NATIVE + in_baseTypeid);\n }\n\n if (in_baseTypeid === \"BaseProperty\" || in_typeid === in_baseTypeid) {\n return true;\n }\n\n if (in_typeid === \"BaseProperty\") {\n return false;\n }\n\n let parents = NativeTypes[in_typeid][\"inherits\"];\n\n // recursively call the function for the parent of the typeid\n for (let i = 0; i < parents.length; i++) {\n if (this.nativeInheritsFrom(parents[i], in_baseTypeid)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * return all primitive typeIds\n *\n * @returns return a list of primitiveTypeIds\n */\n export function getPrimitiveTypeIds(): string[] {\n return templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n }\n\n /**\n * return all reserved typeIds\n *\n * @returns return a list of reservedTypeIds\n */\n export function getReservedTypeIds(): string[] {\n return templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n }\n};\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ChangeSet, SerializedChangeSet } from "./changeset";
|
|
6
6
|
import { ArrayChangeSetIterator } from "./changeset_operations/arrayChangesetIterator";
|
|
7
|
-
import { TypeIdHelper } from "./helpers/typeidHelper";
|
|
7
|
+
import { ExtractedContext, TypeIdHelper } from "./helpers/typeidHelper";
|
|
8
8
|
import { PathHelper } from "./pathHelper";
|
|
9
9
|
import { rebaseToRemoteChanges } from "./rebase";
|
|
10
10
|
import { TemplateSchema } from "./templateSchema";
|
|
11
11
|
import { TemplateValidator } from "./templateValidator";
|
|
12
12
|
import { Utils } from "./utils";
|
|
13
|
-
|
|
13
|
+
declare const TraversalContext: typeof Utils.TraversalContext;
|
|
14
|
+
export { TemplateSchema, TemplateValidator, TypeIdHelper, ChangeSet, Utils, PathHelper, ArrayChangeSetIterator, rebaseToRemoteChanges, SerializedChangeSet, TraversalContext, ExtractedContext };
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAC,MAAM,SAAS,CAAC;AAE/B,QAAA,MAAQ,gBAAgB,+BAAU,CAAC;AAEnC,OAAO,EACH,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,KAAK,EACL,UAAU,EACV,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EACnB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rebaseToRemoteChanges = exports.ArrayChangeSetIterator = exports.PathHelper = exports.Utils = exports.ChangeSet = exports.TypeIdHelper = exports.TemplateValidator = exports.TemplateSchema = void 0;
|
|
3
|
+
exports.TraversalContext = exports.rebaseToRemoteChanges = exports.ArrayChangeSetIterator = exports.PathHelper = exports.Utils = exports.ChangeSet = exports.TypeIdHelper = exports.TemplateValidator = exports.TemplateSchema = void 0;
|
|
4
4
|
/*!
|
|
5
5
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
6
6
|
* Licensed under the MIT License.
|
|
@@ -21,4 +21,6 @@ const templateValidator_1 = require("./templateValidator");
|
|
|
21
21
|
Object.defineProperty(exports, "TemplateValidator", { enumerable: true, get: function () { return templateValidator_1.TemplateValidator; } });
|
|
22
22
|
const utils_1 = require("./utils");
|
|
23
23
|
Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return utils_1.Utils; } });
|
|
24
|
+
const { TraversalContext } = utils_1.Utils;
|
|
25
|
+
exports.TraversalContext = TraversalContext;
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2CAA6D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2CAA6D;AAezD,0FAfK,qBAAS,OAeL;AAdb,0FAAuF;AAiBnF,uGAjBK,+CAAsB,OAiBL;AAhB1B,yDAAwE;AAYpE,6FAZuB,2BAAY,OAYvB;AAXhB,6CAA0C;AActC,2FAdK,uBAAU,OAcL;AAbd,qCAAiD;AAe7C,sGAfK,8BAAqB,OAeL;AAdzB,qDAAkD;AAO9C,+FAPK,+BAAc,OAOL;AANlB,2DAAwD;AAOpD,kGAPK,qCAAiB,OAOL;AANrB,mCAA+B;AAS3B,sFATK,aAAK,OASL;AAPT,MAAM,EAAE,gBAAgB,EAAE,GAAG,aAAK,CAAC;AAY/B,4CAAgB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { ChangeSet, SerializedChangeSet } from \"./changeset\";\nimport { ArrayChangeSetIterator } from \"./changeset_operations/arrayChangesetIterator\";\nimport { ExtractedContext, TypeIdHelper } from \"./helpers/typeidHelper\";\nimport { PathHelper } from \"./pathHelper\";\nimport { rebaseToRemoteChanges } from \"./rebase\";\nimport { TemplateSchema } from \"./templateSchema\";\nimport { TemplateValidator } from \"./templateValidator\";\nimport { Utils} from \"./utils\";\n\nconst { TraversalContext } = Utils;\n\nexport {\n TemplateSchema,\n TemplateValidator,\n TypeIdHelper,\n ChangeSet,\n Utils,\n PathHelper,\n ArrayChangeSetIterator,\n rebaseToRemoteChanges,\n SerializedChangeSet,\n TraversalContext,\n ExtractedContext\n};\n"]}
|