@univerjsnetworkfacadeclassesFnetwork

@univerjs/network v0.5.4


Class: FNetwork

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:22

FBase is a base class for all facade classes. It provides a way to extend classes with static and instance methods. The _initialize as a special method that will be called after the constructor. You should never call it directly.

Extends

Constructors

new FNetwork()

new FNetwork(_injector, _httpService): FNetwork

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:23

Parameters

ParameterType
_injectorInjector
_httpServiceHTTPService

Returns

FNetwork

Overrides

FBase.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseFBase._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96
_httpServicereadonlyHTTPServiceundefined-submodules/univer/packages/network/src/facade/f-network.ts:25
_injectorreadonlyInjectorundefined-submodules/univer/packages/network/src/facade/f-network.ts:24

Methods

delete()

delete<T>(url, params?): Promise<HTTPResponse<T>>

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:66

Send DELETE request to the server.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
urlstringThe requested URL
params?IRequestParamsQuery parameters

Returns

Promise<HTTPResponse<T>>

Network response


dispose()

dispose(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109

Returns

void

Inherited from

FBase.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

FBase.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

FBase.ensureNotDisposed


get()

get<T>(url, params?): Promise<HTTPResponse<T>>

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:36

Send GET request to the server.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
urlstringThe requested URL
params?IRequestParamsQuery parameters

Returns

Promise<HTTPResponse<T>>

Network response


getSSE()

getSSE<T>(
   method, 
   url, 
params?): Observable<HTTPEvent<T>>

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:88

Request for a stream of server-sent events. Instead of a single response, the server sends a stream of responses, Univer wraps the stream in an Observable which you can call subscribe on.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
methodHTTPRequestMethodHTTP request method
urlstringThe requested URL
params?IPostRequestParamsQuery parameters

Returns

Observable<HTTPEvent<T>>

An observable that emits the network response


patch()

patch<T>(url, params?): Promise<HTTPResponse<T>>

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:76

Send PATCH request to the server.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
urlstringThe requested URL
params?IPostRequestParamsQuery parameters

Returns

Promise<HTTPResponse<T>>

Network response


post()

post<T>(url, params?): Promise<HTTPResponse<T>>

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:46

Send POST request to the server.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
urlstringThe requested URL
params?IPostRequestParamsQuery parameters

Returns

Promise<HTTPResponse<T>>

Network response


put()

put<T>(url, params?): Promise<HTTPResponse<T>>

Defined in: submodules/univer/packages/network/src/facade/f-network.ts:56

Send PUT request to the server.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
urlstringThe requested URL
params?IPostRequestParamsQuery parameters

Returns

Promise<HTTPResponse<T>>

Network response


extend()

static extend(source): void

Defined in: submodules/univer/packages/core/src/facade/f-base.ts:26

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FBase.extend