@fedify/koa 2.1.0-dev.405 → 2.1.0-dev.406
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.
- package/dist/index.d.cts +22 -20
- package/dist/index.d.ts +22 -20
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -3,28 +3,30 @@ import { Federation } from "@fedify/fedify/federation";
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
* A factory function to create context data for the {@link Federation} object.
|
|
7
|
+
*
|
|
8
|
+
* @template TContextData A type of the context data for the {@link Federation}
|
|
9
|
+
* object.
|
|
10
|
+
* @template TKoaContext A type of the Koa context.
|
|
11
|
+
* @param context A Koa context object.
|
|
12
|
+
* @returns A context data for the {@link Federation} object.
|
|
13
|
+
* @since 1.9.0
|
|
14
|
+
*/
|
|
15
|
+
// deno-lint-ignore no-explicit-any
|
|
15
16
|
type ContextDataFactory<TContextData, TKoaContext = any> = (context: TKoaContext) => TContextData | Promise<TContextData>;
|
|
16
17
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
* Create a Koa middleware to integrate with the {@link Federation} object.
|
|
19
|
+
*
|
|
20
|
+
* @template TContextData A type of the context data for the {@link Federation}
|
|
21
|
+
* object.
|
|
22
|
+
* @template TKoaContext A type of the Koa context.
|
|
23
|
+
* @param federation A {@link Federation} object to integrate with Koa.
|
|
24
|
+
* @param contextDataFactory A function to create a context data for the
|
|
25
|
+
* {@link Federation} object.
|
|
26
|
+
* @returns A Koa middleware.
|
|
27
|
+
* @since 1.9.0
|
|
28
|
+
*/
|
|
29
|
+
// deno-lint-ignore no-explicit-any
|
|
28
30
|
declare function createMiddleware<TContextData, TKoaContext = any>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData, TKoaContext>): (ctx: TKoaContext, next: () => Promise<void>) => Promise<void>;
|
|
29
31
|
//#endregion
|
|
30
32
|
export { ContextDataFactory, createMiddleware };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,28 +3,30 @@ import { Federation } from "@fedify/fedify/federation";
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
* A factory function to create context data for the {@link Federation} object.
|
|
7
|
+
*
|
|
8
|
+
* @template TContextData A type of the context data for the {@link Federation}
|
|
9
|
+
* object.
|
|
10
|
+
* @template TKoaContext A type of the Koa context.
|
|
11
|
+
* @param context A Koa context object.
|
|
12
|
+
* @returns A context data for the {@link Federation} object.
|
|
13
|
+
* @since 1.9.0
|
|
14
|
+
*/
|
|
15
|
+
// deno-lint-ignore no-explicit-any
|
|
15
16
|
type ContextDataFactory<TContextData, TKoaContext = any> = (context: TKoaContext) => TContextData | Promise<TContextData>;
|
|
16
17
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
* Create a Koa middleware to integrate with the {@link Federation} object.
|
|
19
|
+
*
|
|
20
|
+
* @template TContextData A type of the context data for the {@link Federation}
|
|
21
|
+
* object.
|
|
22
|
+
* @template TKoaContext A type of the Koa context.
|
|
23
|
+
* @param federation A {@link Federation} object to integrate with Koa.
|
|
24
|
+
* @param contextDataFactory A function to create a context data for the
|
|
25
|
+
* {@link Federation} object.
|
|
26
|
+
* @returns A Koa middleware.
|
|
27
|
+
* @since 1.9.0
|
|
28
|
+
*/
|
|
29
|
+
// deno-lint-ignore no-explicit-any
|
|
28
30
|
declare function createMiddleware<TContextData, TKoaContext = any>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData, TKoaContext>): (ctx: TKoaContext, next: () => Promise<void>) => Promise<void>;
|
|
29
31
|
//#endregion
|
|
30
32
|
export { ContextDataFactory, createMiddleware };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/koa",
|
|
3
|
-
"version": "2.1.0-dev.
|
|
3
|
+
"version": "2.1.0-dev.406+61a21e4e",
|
|
4
4
|
"description": "Integrate Fedify with Koa",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fedify",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
],
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"koa": "^2.0.0 || ^3.0.0",
|
|
53
|
-
"@fedify/fedify": "^2.1.0-dev.
|
|
53
|
+
"@fedify/fedify": "^2.1.0-dev.406+61a21e4e"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/koa": "^2.15.0",
|