From 9f818d52bdc61b5af18d0f19e3b53447cd0f989d Mon Sep 17 00:00:00 2001 From: danielpeintner Date: Tue, 23 Jul 2024 17:06:54 +0200 Subject: [PATCH] docs: add deprecation message (#1310) --- packages/td-tools/src/td-helpers.ts | 3 +++ packages/td-tools/src/td-parser.ts | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/td-tools/src/td-helpers.ts b/packages/td-tools/src/td-helpers.ts index 3efa4ec77..bc95aee72 100644 --- a/packages/td-tools/src/td-helpers.ts +++ b/packages/td-tools/src/td-helpers.ts @@ -43,6 +43,9 @@ export function findPort(td: ThingDescription): number { return parseInt(returnString); } +/** + * @deprecated This function will be removed in the future. + */ export function setContextLanguage(thing: ThingDescription, language: string, forceOverride: boolean): void { // forceOverride == false -> set @language if no @language set // forceOverride == true -> set/override @language in any case diff --git a/packages/td-tools/src/td-parser.ts b/packages/td-tools/src/td-parser.ts index 03d24dba0..13f0bfb1e 100644 --- a/packages/td-tools/src/td-parser.ts +++ b/packages/td-tools/src/td-parser.ts @@ -55,7 +55,10 @@ function adjustBooleanField(affordance: AffordanceElement, key: string) { } } -/** Parses a TD into a Thing object */ +/** Parses a TD into a Thing object + * + * @deprecated This function will be removed in the future. + */ export function parseTD(td: string, normalize?: boolean): Thing { logDebug(`parseTD() parsing\n\`\`\`\n${td}\n\`\`\``); @@ -220,7 +223,10 @@ export function parseTD(td: string, normalize?: boolean): Thing { return thing; } -/** Serializes a Thing object into a TD */ +/** Serializes a Thing object into a TD + * + * @deprecated This function will be removed in the future. + */ export function serializeTD(thing: Thing): string { const copy: Thing = JSON.parse(JSON.stringify(thing));