@@ -2,12 +2,12 @@ import { type App, h, render } from 'vue'
22import { defu } from 'defu'
33
44import type { NinjaToasterTheme } from '../theme'
5- import type { NinjaToasterProps } from '../props'
5+ import type { NinjaToasterBaseProps , NinjaToasterProps } from '../props'
66import type { NinjaToasterRenderQueue } from './queue'
77import { type NinjaToastEventBus , createEventBus } from './events'
88import NinjaToaster from './components/NinjaToaster'
99
10- import { useAppConfig , useNuxtApp , useRuntimeConfig } from '#imports'
10+ import { useAppConfig , useNuxtApp } from '#imports'
1111
1212function createElement ( ) {
1313 if ( process . server ) {
@@ -43,24 +43,26 @@ export interface NinjaToasterShow {
4343}
4444
4545export function createNinjaToaster (
46- createOptions : Omit < NinjaToasterProps , 'content' > = { }
46+ createProps : Omit < NinjaToasterProps , 'content' > = { }
4747) {
4848 const events = createEventBus ( )
4949 const queues : Map < string , NinjaToasterRenderQueue > = new Map ( )
5050
5151 function show ( options : NinjaToasterProps | string | number ) {
52- const appConfigProps = ( useAppConfig ( ) as any ) . toaster as NinjaToasterProps
52+ const appConfigProps : NinjaToasterBaseProps = ( useAppConfig ( ) as any )
53+ . toaster
5354 const app = useNuxtApp ( ) . vueApp
5455 const userProps =
5556 typeof options === 'string' ||
5657 typeof options === 'number' ||
5758 typeof options === 'function'
5859 ? { content : options }
5960 : options
61+
6062 const props : NinjaToasterProps = defu (
61- appConfigProps ,
62- createOptions ,
63- userProps
63+ userProps ,
64+ createProps ,
65+ appConfigProps
6466 )
6567
6668 return new Promise < NinjaToasterShow > ( ( resolve ) => {
0 commit comments