mirror of
https://github.com/logos-messaging/waku-react.git
synced 2026-01-02 14:13:10 +00:00
Merge pull request #49 from waku-org/feat/upgrade-js-waku
chore(js-waku): upgrade to 0.29
This commit is contained in:
commit
559159a04e
9434
package-lock.json
generated
9434
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -87,8 +87,7 @@
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@waku/interfaces": "^0.0.27",
|
||||
"@waku/sdk": "^0.0.28",
|
||||
"@waku/sdk": "^0.0.29",
|
||||
"react": "^16.8.0 || ^17 || ^18"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import type { Waku } from "@waku/interfaces";
|
||||
import type { IWaku } from "@waku/interfaces";
|
||||
|
||||
import type {
|
||||
BootstrapNodeOptions,
|
||||
@ -9,9 +9,9 @@ import type {
|
||||
} from "./types";
|
||||
import { useCreateLightNode } from "./useCreateWaku";
|
||||
|
||||
type WakuContextType<T extends Waku> = CreateNodeResult<T>;
|
||||
type WakuContextType<T extends IWaku> = CreateNodeResult<T>;
|
||||
|
||||
const WakuContext = React.createContext<WakuContextType<Waku>>({
|
||||
const WakuContext = React.createContext<WakuContextType<IWaku>>({
|
||||
node: undefined,
|
||||
isLoading: false,
|
||||
error: undefined,
|
||||
@ -29,7 +29,7 @@ const WakuContext = React.createContext<WakuContextType<Waku>>({
|
||||
* const { node, isLoading, error } = useWaku();
|
||||
* @returns WakuContext
|
||||
*/
|
||||
export const useWaku = <T extends Waku>(): WakuContextType<T> =>
|
||||
export const useWaku = <T extends IWaku>(): WakuContextType<T> =>
|
||||
React.useContext(WakuContext) as WakuContextType<T>;
|
||||
|
||||
type ProviderProps<T> = ReactChildrenProps & BootstrapNodeOptions<T>;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import type { Protocols, Waku } from "@waku/interfaces";
|
||||
import type { IWaku, Protocols } from "@waku/interfaces";
|
||||
import type { waku } from "@waku/sdk";
|
||||
export type { CreateWakuNodeOptions } from "@waku/sdk";
|
||||
|
||||
@ -7,7 +7,7 @@ export type HookState = {
|
||||
error: undefined | string;
|
||||
};
|
||||
|
||||
export type CreateNodeResult<T extends Waku> = HookState & {
|
||||
export type CreateNodeResult<T extends IWaku> = HookState & {
|
||||
node: undefined | T;
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import type { LightNode, Waku } from "@waku/interfaces";
|
||||
import type { IWaku, LightNode } from "@waku/interfaces";
|
||||
import { createLightNode, waitForRemotePeer } from "@waku/sdk";
|
||||
|
||||
import type {
|
||||
@ -10,11 +10,11 @@ import type {
|
||||
|
||||
type NodeFactory<N, T = {}> = (options?: T) => Promise<N>;
|
||||
|
||||
type CreateNodeParams<N extends Waku, T = {}> = BootstrapNodeOptions<T> & {
|
||||
type CreateNodeParams<N extends IWaku, T = {}> = BootstrapNodeOptions<T> & {
|
||||
factory: NodeFactory<N, T>;
|
||||
};
|
||||
|
||||
const useCreateNode = <N extends Waku, T = {}>(
|
||||
const useCreateNode = <N extends IWaku, T = {}>(
|
||||
params: CreateNodeParams<N, T>,
|
||||
): CreateNodeResult<N> => {
|
||||
const { factory, options, protocols = [] } = params;
|
||||
|
||||
@ -3,13 +3,13 @@ import type {
|
||||
IDecodedMessage,
|
||||
IDecoder,
|
||||
IFilter,
|
||||
IWaku,
|
||||
Unsubscribe,
|
||||
Waku,
|
||||
} from "@waku/interfaces";
|
||||
|
||||
import type { HookState } from "./types";
|
||||
|
||||
type AbstractFilterNode = Waku & {
|
||||
type AbstractFilterNode = IWaku & {
|
||||
filter: IFilter;
|
||||
};
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import React from "react";
|
||||
import type {
|
||||
IEncoder,
|
||||
ILightPushSDK,
|
||||
ILightPush,
|
||||
IMessage,
|
||||
IWaku,
|
||||
SDKProtocolResult,
|
||||
Waku,
|
||||
} from "@waku/interfaces";
|
||||
|
||||
type AbstractLightPushNode = Waku & {
|
||||
lightPush: ILightPushSDK;
|
||||
type AbstractLightPushNode = IWaku & {
|
||||
lightPush: ILightPush;
|
||||
};
|
||||
|
||||
type UseLightPushParams = {
|
||||
|
||||
@ -2,15 +2,15 @@ import React from "react";
|
||||
import type {
|
||||
IDecodedMessage,
|
||||
IDecoder,
|
||||
IStoreSDK,
|
||||
IStore,
|
||||
IWaku,
|
||||
QueryRequestParams,
|
||||
Waku,
|
||||
} from "@waku/interfaces";
|
||||
|
||||
import type { HookState } from "./types";
|
||||
|
||||
type AbstractStoreNode = Waku & {
|
||||
store: IStoreSDK;
|
||||
type AbstractStoreNode = IWaku & {
|
||||
store: IStore;
|
||||
};
|
||||
|
||||
type UseStoreMessagesParams = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user