From 80468b1529114da15913fdfcb51d4220cd2b0263 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Fri, 23 Sep 2022 11:21:29 -0400 Subject: [PATCH] foundkey-js: Change Misskey import to foundkey --- packages/foundkey-js/test-d/api.ts | 22 +++++++++++----------- packages/foundkey-js/test-d/streaming.ts | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/foundkey-js/test-d/api.ts b/packages/foundkey-js/test-d/api.ts index ce793f6fd..596ad82bd 100644 --- a/packages/foundkey-js/test-d/api.ts +++ b/packages/foundkey-js/test-d/api.ts @@ -1,45 +1,45 @@ import { expectType } from 'tsd'; -import * as Misskey from '../src'; +import * as foundkey from '../src'; describe('API', () => { test('success', async () => { - const cli = new Misskey.api.APIClient({ + const cli = new foundkey.api.APIClient({ origin: 'https://misskey.test', credential: 'TOKEN' }); const res = await cli.request('meta', { detail: true }); - expectType(res); + expectType(res); }); test('conditional respose type (meta)', async () => { - const cli = new Misskey.api.APIClient({ + const cli = new foundkey.api.APIClient({ origin: 'https://misskey.test', credential: 'TOKEN' }); const res = await cli.request('meta', { detail: true }); - expectType(res); + expectType(res); const res2 = await cli.request('meta', { detail: false }); - expectType(res2); + expectType(res2); const res3 = await cli.request('meta', { }); - expectType(res3); + expectType(res3); const res4 = await cli.request('meta', { detail: true as boolean }); - expectType(res4); + expectType(res4); }); test('conditional respose type (users/show)', async () => { - const cli = new Misskey.api.APIClient({ + const cli = new foundkey.api.APIClient({ origin: 'https://misskey.test', credential: 'TOKEN' }); const res = await cli.request('users/show', { userId: 'xxxxxxxx' }); - expectType(res); + expectType(res); const res2 = await cli.request('users/show', { userIds: ['xxxxxxxx'] }); - expectType(res2); + expectType(res2); }); }); diff --git a/packages/foundkey-js/test-d/streaming.ts b/packages/foundkey-js/test-d/streaming.ts index 7ff7f9599..63faa7975 100644 --- a/packages/foundkey-js/test-d/streaming.ts +++ b/packages/foundkey-js/test-d/streaming.ts @@ -1,17 +1,17 @@ import { expectType } from 'tsd'; -import * as Misskey from '../src'; +import * as foundkey from '../src'; describe('Streaming', () => { test('emit type', async () => { - const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); + const stream = new foundkey.Stream('https://misskey.test', { token: 'TOKEN' }); const mainChannel = stream.useChannel('main'); mainChannel.on('notification', notification => { - expectType(notification); + expectType(notification); }); }); test('params type', async () => { - const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); + const stream = new foundkey.Stream('https://misskey.test', { token: 'TOKEN' }); // TODO: 「stream.useChannel の第二引数として受け入れる型が // { // otherparty?: User['id'] | null; @@ -20,7 +20,7 @@ describe('Streaming', () => { // になっている」というテストを行いたいけどtsdでの書き方がわからない const messagingChannel = stream.useChannel('messaging', { otherparty: 'aaa' }); messagingChannel.on('message', message => { - expectType(message); + expectType(message); }); }); });