Skip to content

Commit

Permalink
chore: upgrade to 0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Oct 18, 2024
1 parent 35b3583 commit f026a5d
Show file tree
Hide file tree
Showing 8 changed files with 1,350 additions and 8,129 deletions.
9,438 changes: 1,330 additions & 8,108 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions src/WakuProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import type { Waku } from "@waku/interfaces";
import type { IWaku } from "@waku/interfaces";

import type {
BootstrapNodeOptions,
Expand All @@ -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,
Expand All @@ -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>;
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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;
};

Expand Down
6 changes: 3 additions & 3 deletions src/useCreateWaku.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/useFilterMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
8 changes: 4 additions & 4 deletions src/useLightPush.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
8 changes: 4 additions & 4 deletions src/useStoreMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit f026a5d

Please sign in to comment.