diff --git a/shell/tsconfig.paths.json b/shell/tsconfig.paths.json index 759c1c28f5..72ef53d32c 100644 --- a/shell/tsconfig.paths.json +++ b/shell/tsconfig.paths.json @@ -12,7 +12,10 @@ ], "@pkg/*": [ "../shell/pkg/*" + ], + "@components/*": [ + "../pkg/rancher-components/src/components/*" ] }, }, -} \ No newline at end of file +} diff --git a/shell/types/vue-shim.d.ts b/shell/types/vue-shim.d.ts new file mode 100644 index 0000000000..31176020da --- /dev/null +++ b/shell/types/vue-shim.d.ts @@ -0,0 +1,42 @@ +// eslint-disable-next-line no-unused-vars +import Vue, { ComponentCustomProperties } from 'vue'; +declare module '*.vue' { + export default Vue; +} + +// This is required to keep typescript from complaining. It is required for +// our i18n plugin. For more info see: +// https://v2.vuejs.org/v2/guide/typescript.html?redirect=true#Augmenting-Types-for-Use-with-Plugins +declare module 'vue/types/vue' { + // eslint-disable-next-line no-unused-vars + interface Vue { + /** + * Lookup a given string with the given arguments + * @param raw if set, do not do HTML escaping. + */ + t: { + (key: string, args?: Record, raw?: boolean): string; + (options: { k: string; raw?: boolean; tag?: string | Record; escapehtml?: boolean }): string; + }; + } +} + +declare module '@vue/runtime-core' { + // eslint-disable-next-line no-unused-vars + interface Vue { + t: { + (key: string, args?: Record, raw?: boolean): string; + (options: { k: string; raw?: boolean; tag?: string | Record; escapehtml?: boolean }): string; + } + } + + // eslint-disable-next-line no-unused-vars + interface ComponentCustomProperties { + $t: { + (key: string, args?: Record, raw?: boolean): string; + (options: { k: string; raw?: boolean; tag?: string | Record; escapehtml?: boolean }): string; + } + } +} + +declare module 'js-yaml';