Skip to content

Commit

Permalink
updated types
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-bs committed Aug 15, 2023
1 parent f492ea3 commit a9a2fa7
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 438 deletions.
File renamed without changes
27 changes: 10 additions & 17 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import { NightwatchAPI, Element } from 'nightwatch';
// import { MountingOptions } from '@vue/test-utils';
import type { ComponentConstructorOptions, ComponentProps, SvelteComponent } from 'svelte'

// type GlobalMountOptions = NonNullable<MountingOptions<any>['global']>;
type SvelteComponentOptions<T extends SvelteComponent> = Omit<
ComponentConstructorOptions<ComponentProps<T>>,
'hydrate' | 'target' | '$$inline'
>;

declare module 'nightwatch' {
interface NightwatchAPI {
importScript(
scriptPath: string,
options: { scriptType: string; componentType: string },
callback?: () => void
): this;
// mountComponent(
// componentPath: string,
// options?: {
// props?: MountingOptions<Record<string, any>>['props'];
// plugin?: Pick<GlobalMountOptions, 'plugins'>;
// mocks?: Pick<GlobalMountOptions, 'mocks'>;
// },
// callback?: (this: NightwatchAPI, result: Element) => void
// ): Awaitable<this, Element>;
mountSvelteComponent<T extends SvelteComponent>(
componentPath: string,
options?: SvelteComponentOptions<T>,
callback?: (this: NightwatchAPI, result: Element) => void
): Awaitable<this, Element>;
launchComponentRenderer(): this;
}
}
Loading

0 comments on commit a9a2fa7

Please sign in to comment.