@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 1.54 kB
Source Map (JSON)
{"version":3,"file":"useAppSettingsDialog-DbtEkXa4.mjs","sources":["../../src/components/NcAppSettingsDialog/useAppSettingsDialog.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { InjectionKey, Ref, VNode } from 'vue'\n\nimport { inject } from 'vue'\n\ninterface AppSettingsRegistrationContext {\n\t/**\n\t * Register a new section on the app settings dialog\n\t *\n\t * @param id - The section ID\n\t * @param name - The section name\n\t * @param order - Optional section order in the list\n\t * @param icon - Optional icon component\n\t */\n\tregisterSection(id: string, name: string, order?: number, icon?: VNode[]): void\n\n\t/**\n\t * Unregistered from the app settings dialog to remove it from dialog\n\t *\n\t * @param id - The section ID\n\t */\n\tunregisterSection(id: string): void\n}\n\nexport const APP_SETTINGS_REGISTRATION_KEY: InjectionKey<AppSettingsRegistrationContext> = Symbol.for('NcAppSettingsDialog:registration')\nexport const APP_SETTINGS_LEGACY_DESIGN_KEY: InjectionKey<Ref<boolean>> = Symbol.for('NcAppSettingsDialog:legacy')\n\n/**\n * Get the provided methods from the app settings dialog.\n * This is to be used in the app settings sections.\n */\nexport function useAppSettingsDialog() {\n\treturn inject(APP_SETTINGS_REGISTRATION_KEY)!\n}\n"],"names":[],"mappings":";AA4BO,MAAM,gCAA8E,OAAO,IAAI,kCAAkC;AACjI,MAAM,iCAA6D,OAAO,IAAI,4BAA4B;AAM1G,SAAS,uBAAuB;AACtC,SAAO,OAAO,6BAA6B;AAC5C;"}