swup 4.0.0-rc.20 → 4.0.0-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  import Swup from '../Swup.js';
2
2
  export type Plugin = {
3
- /** Name of this plugin */
4
- name: string;
5
3
  /** Identify as a swup plugin */
6
4
  isSwupPlugin: true;
5
+ /** Name of this plugin */
6
+ name: string;
7
+ /** Version of this plugin. Currently not in use, defined here for backward compatiblity. */
8
+ version?: string;
9
+ /** The swup instance that mounted this plugin */
10
+ swup?: Swup;
11
+ /** Version requirements of this plugin. Example: `{ swup: '>=4' }` */
12
+ requires?: Record<string, string | string[]>;
7
13
  /** Run on mount */
8
14
  mount: () => void;
9
15
  /** Run on unmount */
10
16
  unmount: () => void;
11
- /** The swup instance that mounted this plugin */
12
- swup?: Swup;
13
- /** Version of this plugin. Currently not in use, defined here for backward compatiblity. */
14
- version?: string;
15
- /** Version requirements of this plugin. Example: `{ swup: '>=4' }` */
16
- requires?: Record<string, string>;
17
17
  _beforeMount?: () => void;
18
18
  _afterUnmount?: () => void;
19
19
  _checkRequirements?: () => boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "swup",
3
3
  "amdName": "Swup",
4
- "version": "4.0.0-rc.20",
4
+ "version": "4.0.0-rc.21",
5
5
  "description": "Versatile and extensible page transition library for server-rendered websites",
6
6
  "type": "module",
7
7
  "source": "./src/Swup.ts",
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { Path } from 'path-to-regexp';
2
+
1
3
  import Swup, { type Options } from './Swup.js';
2
4
  import type { CacheData } from './modules/Cache.js';
3
5
  import type {
@@ -8,7 +10,6 @@ import type {
8
10
  ScrollContext,
9
11
  HistoryContext
10
12
  } from './modules/Context.js';
11
- import type { Plugin } from './modules/plugins.js';
12
13
  import type {
13
14
  HookDefinitions,
14
15
  HookName,
@@ -16,7 +17,7 @@ import type {
16
17
  HookUnregister,
17
18
  Handler
18
19
  } from './modules/Hooks.js';
19
- import type { Path } from 'path-to-regexp';
20
+ import type { Plugin } from './modules/plugins.js';
20
21
 
21
22
  export default Swup;
22
23
 
@@ -1,22 +1,20 @@
1
1
  import Swup from '../Swup.js';
2
2
 
3
3
  export type Plugin = {
4
- /** Name of this plugin */
5
- name: string;
6
4
  /** Identify as a swup plugin */
7
5
  isSwupPlugin: true;
6
+ /** Name of this plugin */
7
+ name: string;
8
+ /** Version of this plugin. Currently not in use, defined here for backward compatiblity. */
9
+ version?: string;
10
+ /** The swup instance that mounted this plugin */
11
+ swup?: Swup;
12
+ /** Version requirements of this plugin. Example: `{ swup: '>=4' }` */
13
+ requires?: Record<string, string | string[]>;
8
14
  /** Run on mount */
9
15
  mount: () => void;
10
16
  /** Run on unmount */
11
17
  unmount: () => void;
12
-
13
- /** The swup instance that mounted this plugin */
14
- swup?: Swup;
15
-
16
- /** Version of this plugin. Currently not in use, defined here for backward compatiblity. */
17
- version?: string;
18
- /** Version requirements of this plugin. Example: `{ swup: '>=4' }` */
19
- requires?: Record<string, string>;
20
18
  _beforeMount?: () => void;
21
19
  _afterUnmount?: () => void;
22
20
  _checkRequirements?: () => boolean;