File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export default function ({ debug = false } = {}) {
15
15
name : 'adapter-azure-swa' ,
16
16
17
17
async adapt ( builder ) {
18
+ /** @type {import('./types/swa').StaticWebAppConfig } */
18
19
const swaConfig = {
19
20
routes : [
20
21
{
Original file line number Diff line number Diff line change
1
+ // types adapted from https://docs.microsoft.com/en-us/azure/static-web-apps/configuration
2
+ export interface StaticWebAppConfig {
3
+ routes ?: Route [ ] ;
4
+ navigationFallback ?: NavigationFallback ;
5
+ }
6
+
7
+ export interface Route {
8
+ route : string ;
9
+ methods ?: HttpMethod [ ] ;
10
+ rewrite ?: string ;
11
+ redirect ?: string ;
12
+ statusCode ?: number ;
13
+ headers ?: Record < string , string > ;
14
+ allowedRoles ?: string [ ] ;
15
+ }
16
+
17
+ export interface NavigationFallback {
18
+ rewrite : string ;
19
+ exclude ?: string [ ] ;
20
+ }
21
+
22
+ export type HttpMethod =
23
+ | 'GET'
24
+ | 'HEAD'
25
+ | 'POST'
26
+ | 'PUT'
27
+ | 'DELETE'
28
+ | 'CONNECT'
29
+ | 'OPTIONS'
30
+ | 'TRACE'
31
+ | 'PATCH' ;
You can’t perform that action at this time.
0 commit comments