Skip to content

Commit

Permalink
feat(types): support redirect code
Browse files Browse the repository at this point in the history
  • Loading branch information
stas-nc committed Dec 19, 2024
1 parent 371f0ba commit eb3e736
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
14 changes: 0 additions & 14 deletions .nycrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"trailingComma": "all",
"singleQuote": true,
"tabWidth": 4
}
8 changes: 8 additions & 0 deletions nyc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
all: true,
reporter: 'text',
'check-coverage': true,
lines: 0,
'per-file': true,
exclude: ['**/*.spec.ts', 'dist', 'node_modules', 'browser.js', 'browser.d.ts'],
};
9 changes: 7 additions & 2 deletions src/plugins/transitionHooks/common.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface Route {
url: string;
meta: {
[key: string]: any,
[key: string]: any;
};
hostname: string;
}
Expand All @@ -11,8 +11,13 @@ export interface TransitionContinue {
}

export interface TransitionRedirect {
type: 'redirect';
type: 'redirect'
newLocation: string;
/**
* HTTP redirect code
* @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
*/
code?: 301 | 302 | 303 | 307 | 308;
}

export interface TransitionStopNavigation {
Expand Down

0 comments on commit eb3e736

Please # to comment.