persona-community-5/.pnpm-store/v3/files/cb/ab97451cf9d143e19f8c0287ec105ecd26d8676fec5f77a94757b529a0e08a44924149dac00f7aedeec4b43b45e9d626bafcfc0393eb4e8214090791d8ddac
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

48 lines
1.5 KiB
Plaintext

import * as React from 'react';
export declare type removeCb = () => void;
export declare type MediumCallback<T> = (data: T) => any;
export declare type MiddlewareCallback<T> = (data: T, assigned: boolean) => T;
export declare type SidePush<T> = {
length?: number;
push(data: T): void;
filter(cb: (x: T) => boolean): SidePush<T>;
};
/**
* An object describing side medium
*/
export interface SideMedium<T> {
/**
* Pushes effect to the medium
* @param effect any information for real handler
*/
useMedium(effect: T): removeCb;
/**
* Assigns effect handler to the medium
* @param {Function(effect: T)} handler effect handler
*/
assignMedium(handler: MediumCallback<T>): void;
/**
* Assigns a synchronous effect handler to the medium, which would be executed right on call
* @param {Function(effect: T)} handler effect handler
*/
assignSyncMedium(handler: MediumCallback<T>): void;
/**
* reads the data stored in the medium
*/
read(): T | undefined;
options?: Record<string, any>;
}
export declare type DefaultOrNot<T> = {
default: T;
} | T;
export declare type Importer<T> = () => Promise<DefaultOrNot<React.ComponentType<T>>>;
export declare type SideCarMedium<T = {}> = SideMedium<React.ComponentType<T>>;
export declare type SideCarHOC<T = {}> = {
readonly sideCar: SideCarMedium<T>;
};
export declare type SideCarComponent<T> = React.FunctionComponent<T & SideCarHOC<T>>;
export declare type SideCarMediumOptions = {
async?: boolean;
ssr?: boolean;
};