Added a global `notify` method via Nuxt plugin to replace `useNotification`. Improved messaging structure by embedding progress bars and handled dynamic durations. Updated usage across composables and components for consistency. - Replaced `useNotification` with `$notify` in all applicable files. - Updated `app.config.ts` to support customizable notification positions. - Refactored affected composables for simplified notification calls. - Enhanced progress indicator display within notifications. Breaking Changes: `useNotification` is removed, requiring migration to the new `$notify` API.
43 lines
1 KiB
TypeScript
43 lines
1 KiB
TypeScript
import type { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
import type { ApolloError } from '@apollo/client/errors';
|
|
import type { INotificationArguments } from '~/plugins/03.notification'
|
|
|
|
declare module '#app' {
|
|
interface NuxtApp {
|
|
$appHelpers?: {
|
|
APP_DOMAIN: string;
|
|
APP_NAME: string;
|
|
APP_NAME_KEY: string;
|
|
DEFAULT_LOCALE: string;
|
|
COOKIES_LOCALE_KEY: string;
|
|
COOKIES_REFRESH_TOKEN_KEY: string;
|
|
COOKIES_ACCESS_TOKEN_KEY: string;
|
|
COOKIES_PRODUCT_VIEW_KEY: string;
|
|
COOKIES_THEME_KEY: string;
|
|
};
|
|
$apollo: {
|
|
defaultClient: ApolloClient<NormalizedCacheObject>;
|
|
};
|
|
$notify: (args: INotificationArguments) => void
|
|
}
|
|
|
|
interface NuxtConfig {
|
|
apollo?: {
|
|
autoImports?: boolean;
|
|
clients?: {
|
|
default?: {
|
|
httpEndpoint: string;
|
|
connectToDevTools?: boolean;
|
|
authType?: string;
|
|
authHeader?: string;
|
|
tokenStorage?: 'cookie' | 'localStorage';
|
|
tokenName?: string;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
interface RuntimeNuxtHooks {
|
|
'apollo:error': (error: ApolloError) => void;
|
|
}
|
|
}
|