mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-28 12:32:09 +03:00
fix: error TS2742: The inferred type of 'bareClient' cannot be name (#731)
This commit is contained in:
parent
7fb5aae8b5
commit
ba9a57d4ae
@ -2,11 +2,13 @@ import ky from 'ky-universal';
|
||||
import { MessageCenter } from '../../../message/index.js';
|
||||
import { token } from './token.js';
|
||||
|
||||
type KyInstance = typeof ky;
|
||||
|
||||
const messageCenter = MessageCenter.getInstance();
|
||||
|
||||
const _sendMessage = messageCenter.getMessageSender('affine');
|
||||
|
||||
export const bareClient = ky.extend({
|
||||
export const bareClient: KyInstance = ky.extend({
|
||||
prefixUrl: 'http://localhost:8080',
|
||||
retry: 1,
|
||||
hooks: {
|
||||
@ -26,7 +28,7 @@ export const bareClient = ky.extend({
|
||||
},
|
||||
});
|
||||
|
||||
export const client = bareClient.extend({
|
||||
export const client: KyInstance = bareClient.extend({
|
||||
hooks: {
|
||||
beforeRequest: [
|
||||
async request => {
|
||||
|
Loading…
Reference in New Issue
Block a user