-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.d.ts
44 lines (39 loc) · 1.36 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { Adapter } from '@sveltejs/kit';
import { ClientPrincipal, CustomStaticWebAppConfig } from './types/swa';
import { Context } from '@azure/functions';
import esbuild from 'esbuild';
export * from './types/swa';
export type Options = {
debug?: boolean;
customStaticWebAppConfig?: CustomStaticWebAppConfig;
esbuildOptions?: Pick<esbuild.BuildOptions, 'external' | 'keepNames' | 'loader'>;
apiDir?: string;
staticDir?: string;
allowReservedSwaRoutes?: boolean;
};
export default function plugin(options?: Options): Adapter;
declare global {
namespace App {
export interface Platform {
/**
* Client Principal as passed from Azure
*
* @remarks
*
* Due to a possible in bug in SWA, the client principal is only passed
* to the render function on routes specifically designated as
* protected. Protected in this case means that the `allowedRoles`
* field is populated and does not contain the `anonymous` role.
*
* @see The {@link https://learn.microsoft.com/en-us/azure/static-web-apps/user-information?tabs=javascript#api-functions SWA documentation}
*/
/**
* The Azure function request context.
*
* @see The {@link https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node#context-object Azure function documentation}
*/
clientPrincipal?: ClientPrincipal;
context: Context;
}
}
}