import { TeamsManifest, TeamsManifestLatest } from "../generated-types"; type LatestManifestType = TeamsManifestLatest; type BotType = NonNullable[number]; type StaticTabType = NonNullable[number]; type ConfigurableTabType = NonNullable[number]; type ComposeExtensionType = NonNullable[number]; type ConnectorType = NonNullable[number]; type DeclarativeAgentRefType = NonNullable["declarativeAgents"]>[number]; type CustomEngineAgentType = NonNullable["customEngineAgents"]>[number]; export type Bot = BotType; export type StaticTab = StaticTabType; export type ConfigurableTab = ConfigurableTabType; export type ComposeExtension = ComposeExtensionType; export type Connector = ConnectorType; export type DeclarativeAgentRef = DeclarativeAgentRefType; export type CustomEngineAgent = CustomEngineAgentType; export type Developer = LatestManifestType["developer"]; export type WebApplicationInfo = LatestManifestType["webApplicationInfo"]; /** * Default install scope values derived from the manifest schema. */ export type DefaultInstallScopeValue = NonNullable; /** * Default install scope enum for Teams manifests. */ export declare const DefaultInstallScope: { readonly [K in DefaultInstallScopeValue]: K; }; /** * Static tab scope values derived from the manifest schema. */ export type StaticTabScopeValue = NonNullable[number]; /** * Static tab scope enum for Teams manifests. */ export declare const StaticTabScope: { readonly [K in StaticTabScopeValue]: K; }; /** * Configurable tab scope values derived from the manifest schema. */ export type ConfigurableTabScopeValue = NonNullable[number]; /** * Configurable tab scope enum for Teams manifests. */ export declare const ConfigurableTabScope: { readonly [K in ConfigurableTabScopeValue]: K; }; /** * Compose extension type values derived from the manifest schema. */ export type ComposeExtensionTypeValue = NonNullable; /** * Compose extension type enum for Teams manifests. */ export declare const ComposeExtensionTypeEnum: { readonly [K in ComposeExtensionTypeValue]: K; }; /** * OOP wrapper for Teams App Manifest. * * Provides a fluent API for manipulating Teams app manifests with * type safety, state tracking, and convenient operations. * * Note: This class does not extend BaseManifest due to TeamsManifest union type * constraints, but provides the same interface and functionality. * * @example * ```typescript * // Read existing manifest * const manifest = await TeamsManifestWrapper.read("manifest.json"); * * // Modify with fluent API * manifest * .setName("My App", "My Full App Name") * .setDescription("Short desc", "Full description") * .addBot("bot-id", ["personal", "team"]) * .addStaticTab("home", "Home", "https://example.com/tab") * .addDeclarativeAgent("agent1", "declarativeAgent.json"); * * // Save changes * await manifest.save(); * ``` */ export declare class TeamsManifestWrapper { protected _data: TeamsManifest; protected _filePath?: string; protected _isDirty: boolean; private constructor(); /** * Returns the raw manifest data. */ get data(): Readonly; /** * Returns the file path if the manifest was loaded from a file. */ get filePath(): string | undefined; /** * Indicates whether the manifest has unsaved changes. */ get isDirty(): boolean; /** * Marks the manifest as having unsaved changes. */ protected markDirty(): void; /** * Saves the manifest to the specified file path or the original file path. * @param filePath - Optional path to save to. If not provided, uses the original file path. * @throws Error if no file path is available. */ save(filePath?: string): Promise; /** * Reads a JSON file synchronously and returns the parsed object. * @param filePath - Path to the JSON file */ private static readJsonFileSync; /** * Reads a Teams manifest from a file. * @param filePath - Path to the manifest JSON file. * @returns A new TeamsManifestWrapper instance. */ static read(filePath: string): Promise; /** * Reads a Teams manifest from a file synchronously. * @param filePath - Path to the manifest JSON file. * @returns A new TeamsManifestWrapper instance. */ static readSync(filePath: string): TeamsManifestWrapper; /** * Creates a TeamsManifestWrapper from a JSON string. * @param json - JSON string representing the manifest. * @returns A new TeamsManifestWrapper instance. */ static fromJSON(json: string): TeamsManifestWrapper; /** * Creates a new Teams manifest with required fields. * @param init - Initial manifest data with required fields. * @returns A new TeamsManifestWrapper instance. */ static create(init: { manifestVersion: TeamsManifest["manifestVersion"]; id: string; version: string; name: { short: string; full?: string; }; description: { short: string; full: string; }; developer: { name: string; websiteUrl: string; privacyUrl: string; termsOfUseUrl: string; mpnId?: string; }; accentColor?: string; }): TeamsManifestWrapper; /** * Returns the manifest version. */ get manifestVersion(): string; /** * Returns the app ID. */ get id(): string; /** * Returns the app version. */ get version(): string; /** * Returns the app name. */ get name(): { short: string; full?: string; }; /** * Returns the app description. */ get description(): { short: string; full: string; }; /** * Returns the developer information. */ get developer(): Developer; /** * Returns the icons configuration. */ get icons(): { color: string; outline: string; }; /** * Returns a readonly array of bots. */ get bots(): readonly BotType[]; /** * Returns a readonly array of static tabs. */ get staticTabs(): readonly StaticTabType[]; /** * Returns a readonly array of configurable tabs. */ get configurableTabs(): readonly ConfigurableTabType[]; /** * Returns a readonly array of compose extensions (message extensions). */ get composeExtensions(): readonly ComposeExtensionType[]; /** * Returns a readonly array of connectors. */ get connectors(): readonly ConnectorType[]; /** * Returns the valid domains. */ get validDomains(): readonly string[]; /** * Returns the web application info for SSO. */ get webApplicationInfo(): WebApplicationInfo | undefined; /** * Returns the copilot agents configuration. */ get copilotAgents(): LatestManifestType["copilotAgents"] | undefined; /** * Returns a readonly array of declarative agents. */ get declarativeAgents(): readonly DeclarativeAgentRefType[]; /** * Returns a readonly array of custom engine agents. */ get customEngineAgents(): readonly CustomEngineAgentType[]; /** * Sets the app ID. */ setId(id: string): this; /** * Sets the app version. */ setVersion(version: string): this; /** * Sets the app name. */ setName(short: string, full?: string): this; /** * Sets the app description. */ setDescription(short: string, full: string): this; /** * Sets the developer information. */ setDeveloper(developer: Developer): this; /** * Sets the icons. */ setIcons(color: string, outline: string): this; /** * Sets the accent color. */ setAccentColor(color: string): this; /** * Sets the default install scope. */ setDefaultInstallScope(scope: DefaultInstallScopeValue): this; /** * Adds a valid domain. * @param domain - The domain to add. */ addValidDomain(domain: string): this; /** * Removes a valid domain. * @param domain - The domain to remove. */ removeValidDomain(domain: string): this; /** * Adds a bot to the manifest. * @param botId - The Microsoft App ID for the bot. * @param scopes - The scopes for the bot. * @param options - Additional bot configuration options. */ addBot(botId: string, scopes: BotType["scopes"], options?: Partial>): this; /** * Removes a bot by ID. * @param botId - The bot ID to remove. */ removeBot(botId: string): this; /** * Checks if a bot exists by ID. */ hasBot(botId: string): boolean; /** * Gets a bot by ID. */ getBot(botId: string): BotType | undefined; /** * Adds a static tab to the manifest. * @param entityId - Unique identifier for the tab entity. * @param name - Display name of the tab. * @param contentUrl - URL for the tab content. * @param scopes - The scopes for the tab. */ addStaticTab(entityId: string, name: string, contentUrl: string, scopes?: StaticTabType["scopes"]): this; /** * Removes a static tab by entity ID. * @param entityId - The entity ID of the tab to remove. */ removeStaticTab(entityId: string): this; /** * Checks if a static tab exists by entity ID. */ hasStaticTab(entityId: string): boolean; /** * Gets a static tab by entity ID. */ getStaticTab(entityId: string): StaticTabType | undefined; /** * Adds a configurable tab to the manifest. * @param configurationUrl - URL for the tab configuration. * @param scopes - The scopes for the tab. */ addConfigurableTab(configurationUrl: string, scopes?: ConfigurableTabType["scopes"]): this; /** * Removes a configurable tab by configuration URL. * @param configurationUrl - The configuration URL of the tab to remove. */ removeConfigurableTab(configurationUrl: string): this; /** * Adds a compose extension to the manifest. * @param extension - The compose extension configuration. */ addComposeExtension(extension: ComposeExtensionType): this; /** * Adds a bot-based compose extension. * @param botId - The bot ID for the message extension. * @param commands - The commands for the message extension. */ addBotBasedComposeExtension(botId: string, commands?: ComposeExtensionType["commands"]): this; /** * Adds an API-based compose extension. * @param apiSpecificationFile - Path to the API specification file. * @param commands - The commands for the message extension. */ addApiBasedComposeExtension(apiSpecificationFile: string, commands?: ComposeExtensionType["commands"]): this; /** * Removes a compose extension by bot ID. * @param botId - The bot ID of the compose extension to remove. */ removeComposeExtensionByBotId(botId: string): this; /** * Sets the web application info for SSO. * @param id - The AAD application ID. * @param resource - Optional resource URL for acquiring auth token. */ setWebApplicationInfo(id: string, resource?: string): this; /** * Removes the web application info. */ removeWebApplicationInfo(): this; /** * Adds a declarative agent reference. * @param id - Unique identifier for the agent. * @param file - Relative path to the agent manifest file. */ addDeclarativeAgent(id: string, file: string): this; /** * Removes a declarative agent by ID. * @param id - The ID of the agent to remove. */ removeDeclarativeAgent(id: string): this; /** * Checks if a declarative agent exists by ID. */ hasDeclarativeAgent(id: string): boolean; /** * Gets a declarative agent by ID. */ getDeclarativeAgent(id: string): DeclarativeAgentRefType | undefined; /** * Adds a custom engine agent. * @param id - The bot ID for the custom engine agent. */ addCustomEngineAgent(id: string): this; /** * Removes a custom engine agent by ID. * @param id - The ID of the agent to remove. */ removeCustomEngineAgent(id: string): this; /** * Returns all bot IDs from the manifest. */ getBotIds(): string[]; /** * Returns all static tab entity IDs. */ getStaticTabEntityIds(): string[]; /** * Returns all declarative agent file paths. */ getDeclarativeAgentPaths(): string[]; /** * Checks if the manifest has any Copilot agent configuration. */ hasCopilotAgents(): boolean; /** * Validates the manifest against its JSON schema. * @returns Array of validation error messages, empty if valid. */ validate(): Promise; /** * Converts the manifest to a formatted JSON string. */ toJSON(): string; /** * Creates a deep clone of this manifest. */ clone(): TeamsManifestWrapper; /** * Creates a deep clone with partial modifications applied. * Useful for creating a modified copy without mutating the original. * @param changes - Partial manifest data to merge into the clone. * @returns A new TeamsManifestWrapper with the changes applied. */ cloneWith(changes: Partial & Record): TeamsManifestWrapper; /** * Returns a mutable reference to the manifest data for direct modification. * Use with caution - prefer using the fluent API methods when possible. * Changes made through this reference will be tracked as dirty. */ get mutableData(): TeamsManifest; } export {};