chore: integrate misskey-js as a workspace item (git subtree) (#10409)

* Additional changes for the merge

* api-misskey-js
This commit is contained in:
Kagami Sascha Rosylight
2023-03-30 02:33:19 +02:00
committed by GitHub
parent a529b0e5a3
commit cee1d5e2d0
34 changed files with 7008 additions and 97 deletions

View File

@@ -0,0 +1,26 @@
import { expectType } from 'tsd';
import * as Misskey from '../src';
describe('Streaming', () => {
test('emit type', async () => {
const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' });
const mainChannel = stream.useChannel('main');
mainChannel.on('notification', notification => {
expectType<Misskey.entities.Notification>(notification);
});
});
test('params type', async () => {
const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' });
// TODO: 「stream.useChannel の第二引数として受け入れる型が
// {
// otherparty?: User['id'] | null;
// group?: UserGroup['id'] | null;
// }
// になっている」というテストを行いたいけどtsdでの書き方がわからない
const messagingChannel = stream.useChannel('messaging', { otherparty: 'aaa' });
messagingChannel.on('message', message => {
expectType<Misskey.entities.MessagingMessage>(message);
});
});
});