Перейти к основному содержимому

MineflowContextValue

@mineflow/client-react


@mineflow/client-react / MineflowContextValue

Interface: MineflowContextValue

Defined in: client-react/src/context.ts:10

Значение контекста SDK, которое MineflowProvider раздаёт всем хукам. Транспорт (rest/authFetch) собирается провайдером один раз и не зависит от смены roles (см. provider).

Properties

authFetch

authFetch: {
(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
(input: string | Request | URL, init?: RequestInit): Promise<Response>;
};

Defined in: client-react/src/context.ts:14

Аутентифицированный fetch (Bearer) для SSE-стримов и кастомных запросов.

Call Signature

(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;

MDN Reference

Parameters
ParameterType
inputRequestInfo | URL
init?RequestInit
Returns

Promise<Response>

Call Signature

(input: string | Request | URL, init?: RequestInit): Promise<Response>;

MDN Reference

Parameters
ParameterType
inputstring | Request | URL
init?RequestInit
Returns

Promise<Response>


baseUrl

baseUrl: string;

Defined in: client-react/src/context.ts:16

Origin API (пути уже включают /api/v1).


rest

rest: MineflowClient;

Defined in: client-react/src/context.ts:12

openapi-fetch клиент для типизированных REST-запросов.


roles

roles: readonly SystemRole[];

Defined in: client-react/src/context.ts:18

Канонические роли текущего пользователя (из auth-адаптера).