@akala/core
Version:
79 lines (78 loc) • 3.08 kB
JavaScript
import { Router } from './router.js';
import { RouterAsync } from './router-async.js';
export * from './route.js';
export * from './router.js';
export * from './route-async.js';
export * from './router-async.js';
/**
* Router for handling a single routable type without additional parameters.
* Ideal for client-side routing where no response is expected.
*
* @template T - The type of routable component.
* @template TSpecialNextParam - Type for special next parameters (defaults to SpecialNextParam)
* @extends Router<[T],TSpecialNextParam>
*/
export class Router1 extends Router {
/**
* Creates an instance of Router1.
* @param {RouterOptions} [options] - Optional configuration options for the router. These configure middleware priority and other router behavior.
*/
constructor(options) {
super(options);
}
}
/**
/**
* Router for handling one routable type and a secondary parameter (e.g., server response).
* Useful in server-side scenarios where a response parameter is needed.
*
* @template T - The first routable type.
* @template U - The second parameter type.
* @template TSpecialNextParam - Type for special next parameters (defaults to SpecialNextParam)
* @extends Router<[T,U],TSpecialNextParam>
*/
export class Router2 extends Router {
/**
* Creates an instance of Router2.
* @param {RouterOptions} [options] - Optional configuration options for the router. These configure middleware priority and other router behavior.
*/
constructor(options) {
super(options);
}
}
/**
* Asynchronous router for handling a single routable type without additional parameters.
* Suitable for client-side asynchronous operations where no response is expected.
*
* @template T - The type of routable component.
* @template TSpecialNextParam - Type for special next parameters (defaults to SpecialNextParam)
* @extends RouterAsync<[T],TSpecialNextParam>
*/
export class Router1Async extends RouterAsync {
/**
* Creates an instance of Router1Async.
* @param {RouterOptions} [options] - Optional configuration options for the router. These configure middleware priority and other router behavior.
*/
constructor(options) {
super(options);
}
}
/**
* Asynchronous router for handling one routable type and a secondary parameter (e.g., server response).
* Useful in server-side scenarios requiring asynchronous operations with a response parameter.
*
* @template T - The first routable type.
* @template U - The second parameter type.
* @template TSpecialNextParam - Type for special next parameters (defaults to SpecialNextParam)
* @extends RouterAsync<[T,U],TSpecialNextParam>
*/
export class Router2Async extends RouterAsync {
/**
* Creates an instance of Router2Async.
* @param {RouterOptions} [options] - Optional configuration options for the router. These configure middleware priority and other router behavior.
*/
constructor(options) {
super(options);
}
}
//# sourceMappingURL=index.js.map