Skip to content

Commit

Permalink
fix: updated exporting nuxt schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
manchenkoff committed Jun 1, 2024
1 parent ebd22f7 commit fa608f6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 31 deletions.
30 changes: 0 additions & 30 deletions src/index.d.ts

This file was deleted.

29 changes: 28 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,40 @@ import {
useLogger,
} from '@nuxt/kit';
import { defu } from 'defu';
import type { SanctumModuleOptions } from './runtime/types';
import type {
SanctumAppConfig,
SanctumGlobalMiddlewarePageMeta,
SanctumModuleOptions,
} from './runtime/types';
import { defaultModuleOptions } from './config';

type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
};

declare module '@nuxt/schema' {
interface PublicRuntimeConfig {
sanctum: Partial<SanctumModuleOptions>;
}

interface AppConfig {
sanctum?: SanctumAppConfig;
}
}

declare module '#app' {
interface PageMeta {
/**
* @deprecated Use `sanctum.excluded` instead.
*/
excludeFromSanctum?: boolean;
/**
* Sanctum global middleware page configuration.
*/
sanctum?: Partial<SanctumGlobalMiddlewarePageMeta>;
}
}

const MODULE_NAME = 'nuxt-auth-sanctum';

export type ModuleOptions = DeepPartial<SanctumModuleOptions>;
Expand Down

0 comments on commit fa608f6

Please sign in to comment.