mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-29 03:21:38 +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 { MessageCenter } from '../../../message/index.js';
|
||||||
import { token } from './token.js';
|
import { token } from './token.js';
|
||||||
|
|
||||||
|
type KyInstance = typeof ky;
|
||||||
|
|
||||||
const messageCenter = MessageCenter.getInstance();
|
const messageCenter = MessageCenter.getInstance();
|
||||||
|
|
||||||
const _sendMessage = messageCenter.getMessageSender('affine');
|
const _sendMessage = messageCenter.getMessageSender('affine');
|
||||||
|
|
||||||
export const bareClient = ky.extend({
|
export const bareClient: KyInstance = ky.extend({
|
||||||
prefixUrl: 'http://localhost:8080',
|
prefixUrl: 'http://localhost:8080',
|
||||||
retry: 1,
|
retry: 1,
|
||||||
hooks: {
|
hooks: {
|
||||||
@ -26,7 +28,7 @@ export const bareClient = ky.extend({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const client = bareClient.extend({
|
export const client: KyInstance = bareClient.extend({
|
||||||
hooks: {
|
hooks: {
|
||||||
beforeRequest: [
|
beforeRequest: [
|
||||||
async request => {
|
async request => {
|
||||||
|
Loading…
Reference in New Issue
Block a user