{"version":3,"sources":["src/common.speech/SpeechContext.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,qBAAqB,EAExB,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,qBAAa,aAAa;IACtB,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,kBAAkB,CAAwB;gBAEtC,cAAc,EAAE,qBAAqB;IAIjD;;;;OAIG;IACI,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAIjD,MAAM,IAAI,MAAM;CAQ1B","file":"SpeechContext.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\nimport {\n    DynamicGrammarBuilder,\n    IDynamicGrammar,\n} from \"./Exports\";\n\n/**\n * Represents the JSON used in the speech.context message sent to the speech service.\n * The dynamic grammar is always refreshed from the encapsulated dynamic grammar object.\n */\nexport class SpeechContext {\n    private privContext: { [section: string]: any } = {};\n    private privDynamicGrammar: DynamicGrammarBuilder;\n\n    constructor(dynamicGrammar: DynamicGrammarBuilder) {\n        this.privDynamicGrammar = dynamicGrammar;\n    }\n\n    /**\n     * Adds a section to the speech.context object.\n     * @param sectionName Name of the section to add.\n     * @param value JSON serializeable object that represents the value.\n     */\n    public setSection(sectionName: string, value: any): void {\n        this.privContext[sectionName] = value;\n    }\n\n    public toJSON(): string {\n\n        const dgi: IDynamicGrammar = this.privDynamicGrammar.generateGrammarObject();\n        this.setSection(\"dgi\", dgi);\n\n        const ret: string = JSON.stringify(this.privContext);\n        return ret;\n    }\n}\n"]}