Skip to content

Commit d56728b

Browse files
committed
fix(types): Include log plugin API in types
1 parent 0ad1d6d commit d56728b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/plugins/plugin-log.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
import { Plugin } from '../types';
1010

11-
interface LogMetadataData {
11+
interface LogData {
1212
metadata?: any;
1313
}
1414

15-
interface LogMetadataAPI {
15+
export interface LogAPI {
1616
setMetadata(metadata: any): void;
1717
}
1818

@@ -21,7 +21,7 @@ interface LogMetadataAPI {
2121
* During a move, you can set metadata using ctx.log.setMetadata and it will be
2222
* available on the log entry for that move.
2323
*/
24-
const LogPlugin: Plugin<LogMetadataAPI, LogMetadataData> = {
24+
const LogPlugin: Plugin<LogAPI, LogData> = {
2525
name: 'log',
2626

2727
flush: () => ({}),

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { INVALID_MOVE } from './core/constants';
88
import { Auth } from './server/auth';
99
import * as StorageAPI from './server/db/base';
1010
import { EventsAPI } from './plugins/plugin-events';
11+
import { LogAPI } from './plugins/plugin-log';
1112
import { RandomAPI } from './plugins/random/random';
1213

1314
export { StorageAPI };
@@ -74,6 +75,7 @@ export interface Ctx {
7475
// internally there are two contexts, one is a serialized POJO and another
7576
// "enhanced" context that has plugin api methods attached
7677
events?: EventsAPI;
78+
log?: LogAPI;
7779
random?: RandomAPI;
7880
}
7981

0 commit comments

Comments
 (0)