thedesk/src/main/Timeline.ts

19 lines
524 B
TypeScript
Raw Normal View History

2019-04-24 01:07:20 +09:00
import {
ipcMain
2019-04-24 01:07:20 +09:00
} from 'electron'
import Mastodon, { Status, Response } from 'megalodon'
2019-04-24 03:58:06 +09:00
import Client from './Client'
2019-04-24 01:07:20 +09:00
export default class Timeline {
public static ready() {
ipcMain.on('no-auth-streaming', (event: Event, instance: string) => {
2019-04-24 03:58:06 +09:00
const client = Client.getNoAuthClient(instance)
client.get<[Status]>('/timelines/public?local=true')
.then((resp: Response<[Status]>) => {
console.log(resp.data)
})
})
2019-04-24 01:07:20 +09:00
}
}