Add ambient type declarations for @encryptid/sdk subpath imports

The SDK's dist/ directory may not include .d.ts files in all build
environments (server builds without TypeScript). These ambient
declarations prevent "Could not find a declaration file" errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-14 19:38:24 -07:00
parent 4764686bd0
commit 093062ccc2
1 changed files with 50 additions and 0 deletions

50
src/types/encryptid-sdk.d.ts vendored Normal file
View File

@ -0,0 +1,50 @@
/**
* Ambient type declarations for @encryptid/sdk subpath imports.
*
* The SDK's dist/ directory may not include .d.ts files in all environments
* (e.g., when built without TypeScript on the server). These declarations
* prevent "Could not find a declaration file" errors during Docker builds.
*/
declare module "@encryptid/sdk/server/nextjs" {
export function getEncryptIDSession(
request: Request,
options?: Record<string, unknown>
): Promise<Record<string, unknown> | null>;
export function withEncryptID(
handler: (
request: Request,
session: Record<string, unknown>
) => Promise<Response>,
options?: Record<string, unknown>
): (request: Request) => Promise<Response>;
export function createEncryptIDMiddleware(
config?: Record<string, unknown>
): (request: Request) => Promise<Response | null>;
export function checkSpaceAccess(
request: Request,
spaceSlug: string,
options: Record<string, unknown>
): Promise<{
allowed: boolean;
readOnly?: boolean;
reason?: string;
claims?: Record<string, unknown> | null;
}>;
}
declare module "@encryptid/sdk/server" {
export function verifyEncryptIDToken(
token: string,
options?: Record<string, unknown>
): Promise<{
sub: string;
username?: string;
did?: string;
exp?: number;
[key: string]: unknown;
}>;
}