From 1a259ff89dfa6cdae3780b242cd6f5901bd8a661 Mon Sep 17 00:00:00 2001 From: Yusuf Kandemir Date: Thu, 3 Oct 2024 15:04:14 +0300 Subject: [PATCH] feat(app-webpack): improve framework config types --- .../types/configuration/framework-conf.d.ts | 71 +++++++++++++++++-- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/app-webpack/types/configuration/framework-conf.d.ts b/app-webpack/types/configuration/framework-conf.d.ts index 9747134fd48..73ac1f667b7 100644 --- a/app-webpack/types/configuration/framework-conf.d.ts +++ b/app-webpack/types/configuration/framework-conf.d.ts @@ -1,7 +1,9 @@ import { + QuasarComponents, + QuasarDirectives, QuasarIconSets, QuasarLanguageCodes, - QuasarPluginOptions, + QuasarPlugins, QuasarUIConfiguration, } from "quasar"; @@ -13,13 +15,72 @@ type SerializableConfiguration = { }; interface QuasarFrameworkConfiguration { + /** + * @see - QuasarConfOptions tab in API cards throughout the docs + */ config?: SerializableConfiguration; + /** + * One of the Quasar IconSets + * + * @see https://v2.quasar.dev/options/quasar-icon-sets + * + * @example 'material-icons' + */ iconSet?: QuasarIconSets; + /** + * One of the Quasar language packs + * + * @see https://v2.quasar.dev/options/quasar-language-packs + * + * @example 'en-US' + * @example 'es' + */ lang?: QuasarLanguageCodes; + /** + * Quasar CSS addons have breakpoint aware versions of flex and spacing classes + * + * @see https://quasar.dev/layout/grid/introduction-to-flexbox#flex-addons + * @see https://quasar.dev/style/spacing#flex-addons + */ cssAddon?: boolean; - /** @default 'kebab' */ + + /** + * Auto import - how to detect components in your vue files + * "kebab": q-carousel q-page + * "pascal": QCarousel QPage + * "combined": q-carousel QPage + * + * @default 'kebab' + */ autoImportComponentCase?: "kebab" | "pascal" | "combined"; - components?: (keyof QuasarPluginOptions["components"])[]; - directives?: (keyof QuasarPluginOptions["directives"])[]; - plugins?: (keyof QuasarPluginOptions["plugins"])[]; + + /** + * Quasar will auto import components based on your usage. + * But, in case you have a special case, you can manually specify Quasar components to be available everywhere. + * + * An example case would be having custom component definitions with plain string templates, inside .js or .ts files, + * in which you are using Quasar components (e.g. q-avatar). + * + * Another example would be that dynamically rendering components depending on an API response or similar (e.g. in a CMS), + * something like `` where `dynamicName` is a string that matches a Quasar component name. + * + * @example ['QAvatar', 'QChip'] + */ + components?: (keyof QuasarComponents)[]; + /** + * Quasar will auto import directives based on your usage. + * But, in case you have a special case, you can manually specify Quasar directives to be available everywhere. + * + * An example case would be having custom component definitions with plain string templates, inside .js or .ts files, + * in which you are using Quasar directives (e.g. v-intersection). + * + * @example ['Intersection', 'Mutation'] + */ + directives?: (keyof QuasarDirectives)[]; + /** + * Quasar plugins to be installed. Specify the ones you are using in your app. + * + * @example ['Notify', 'Loading', 'Meta', 'AppFullscreen'] + */ + plugins?: (keyof QuasarPlugins)[]; }