-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
59 lines (51 loc) · 1.33 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/// <reference path="./node_modules/@wordpress/element/build-types/react.d.ts" />
type FeedEntry = {
title: string;
description: React.ReactNode | string[];
variant: "info" | "success" | "error" | "warning";
autoDismiss: number;
onDismiss?: (id: string) => void;
position: "bottom-left" | "bottom-center" | "top-center";
};
type PluginState = {
wp: { comingSoon: boolean };
params: URLSearchParams;
location: string;
};
type PluginModules = {
navigate: (location: string) => void;
notify: { push: (id: string, message: FeedEntry) => void };
};
type PluginActions = {
toggleComingSoon: () => Promise<void>;
};
type NewfoldECommerceProps = {
state: PluginState;
wpModules: PluginModules;
actions: PluginActions;
};
export type NewfoldECommerce = (props: NewfoldECommerceProps) => JSX.Element;
type BrandSettings = {
brand: string;
name: string;
url: string;
hireExpertsInfo: string;
support: string;
adminPage: string;
setup: { payment: string[]; shipping: string[] };
defaultContact: {
woocommerce_default_country: string;
woocommerce_currency: string;
};
};
declare module "@newfold-labs/wp-module-runtime" {
export interface DefaultSdk {
ecommerce: {
brand_settings: BrandSettings;
install_token: string;
nonces: {
gateway_toggle: string;
};
};
}
}