@inappstory/react-sdk 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -171
- package/dist/types/appearance-manager/AppearanceManager.d.ts +38 -38
- package/dist/types/appearance-manager/AppearanceManager.h.d.ts +26 -26
- package/dist/types/appearance-manager/appearanceCommon.d.ts +20 -20
- package/dist/types/appearance-manager/gameReader.ts +32 -32
- package/dist/types/appearance-manager/goodsWidget.ts +38 -38
- package/dist/types/appearance-manager/index.d.ts +8 -8
- package/dist/types/appearance-manager/storiesList.d.ts +128 -128
- package/dist/types/appearance-manager/storyFavoriteReader.ts +19 -19
- package/dist/types/appearance-manager/storyReader.ts +83 -83
- package/dist/types/appearance-manager/utils.d.ts +7 -7
- package/dist/types/index.d.ts +6 -6
- package/dist/types/story-list/StoryList.d.ts +19 -15
- package/dist/types/story-list/UGCStoryList.d.ts +4 -0
- package/dist/types/story-list/navigationViewModel.d.ts +14 -0
- package/dist/types/story-list/storyCardViewModel.d.ts +34 -0
- package/dist/types/story-list/storyListLoadStatus.ts +11 -11
- package/dist/types/story-list/storyListViewModel.d.ts +27 -27
- package/dist/types/story-list/viewModel.d.ts +5 -5
- package/dist/types/story-manager/StoryManager.d.ts +45 -45
- package/package.json +3 -12
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import { CloseButtonPosition } from "./appearanceCommon";
|
|
2
|
-
import { GameReaderOptions } from "./gameReader";
|
|
3
|
-
/// <reference path="../global.d.ts" />
|
|
4
|
-
|
|
5
|
-
export type StoryReaderSwipeStyle = "flat" | "cover" | "cube"
|
|
6
|
-
|
|
7
|
-
export type SharePanelTargets = "vk" | "ok" | "facebook" | "twitter" | "linkedin" | "telegram"
|
|
8
|
-
|
|
9
|
-
export type StoryReaderOptions = {
|
|
10
|
-
gameReaderOptions: GameReaderOptions,
|
|
11
|
-
closeButtonPosition?: CloseButtonPosition,
|
|
12
|
-
scrollStyle: StoryReaderSwipeStyle,
|
|
13
|
-
timelineBlockTopOffset: Nullable<number>,
|
|
14
|
-
actionPanelBottomOffset: Nullable<number>,
|
|
15
|
-
borderRadius: Optional<number>
|
|
16
|
-
loader?: {
|
|
17
|
-
default: {
|
|
18
|
-
color: Optional<string>,
|
|
19
|
-
accentColor: Optional<string>,
|
|
20
|
-
},
|
|
21
|
-
custom: Optional<string>
|
|
22
|
-
},
|
|
23
|
-
recycleStoriesList?: boolean,
|
|
24
|
-
closeOnLastSlideByTimer?: boolean,
|
|
25
|
-
sharePanel: {
|
|
26
|
-
targets: Array<SharePanelTargets>
|
|
27
|
-
copyButton?: {
|
|
28
|
-
svgSrc: {
|
|
29
|
-
baseState: string,
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
downloadButton?: {
|
|
33
|
-
svgSrc: {
|
|
34
|
-
baseState: string,
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
commonBackdrop?: {
|
|
39
|
-
color: Option<string>, // colorValue
|
|
40
|
-
backdropFilter: Option<string> // null or blur(3px)
|
|
41
|
-
},
|
|
42
|
-
slideBackdrop?: {
|
|
43
|
-
opacity: number, // .56
|
|
44
|
-
blur: number, // 30
|
|
45
|
-
linearGradientOverlay: Array<string> // ["rgba(0, 0, 0, 0.1) 0%", "rgba(0, 0, 0, 0.9) 100%"]
|
|
46
|
-
},
|
|
47
|
-
faviconApiUrl: string,
|
|
48
|
-
closeButton?: {
|
|
49
|
-
svgSrc: {
|
|
50
|
-
baseState: string
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
likeButton: {
|
|
54
|
-
svgSrc: {
|
|
55
|
-
baseState: string,
|
|
56
|
-
activeState: string,
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
dislikeButton: {
|
|
60
|
-
svgSrc: {
|
|
61
|
-
baseState: string,
|
|
62
|
-
activeState: string,
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
favoriteButton: {
|
|
66
|
-
svgSrc: {
|
|
67
|
-
baseState: string,
|
|
68
|
-
activeState: string,
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
muteButton: {
|
|
72
|
-
svgSrc: {
|
|
73
|
-
baseState: string,
|
|
74
|
-
activeState: string,
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
shareButton: {
|
|
78
|
-
svgSrc: {
|
|
79
|
-
baseState: string,
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
import { CloseButtonPosition } from "./appearanceCommon";
|
|
2
|
+
import { GameReaderOptions } from "./gameReader";
|
|
3
|
+
/// <reference path="../global.d.ts" />
|
|
4
|
+
|
|
5
|
+
export type StoryReaderSwipeStyle = "flat" | "cover" | "cube"
|
|
6
|
+
|
|
7
|
+
export type SharePanelTargets = "vk" | "ok" | "facebook" | "twitter" | "linkedin" | "telegram"
|
|
8
|
+
|
|
9
|
+
export type StoryReaderOptions = {
|
|
10
|
+
gameReaderOptions: GameReaderOptions,
|
|
11
|
+
closeButtonPosition?: CloseButtonPosition,
|
|
12
|
+
scrollStyle: StoryReaderSwipeStyle,
|
|
13
|
+
timelineBlockTopOffset: Nullable<number>,
|
|
14
|
+
actionPanelBottomOffset: Nullable<number>,
|
|
15
|
+
borderRadius: Optional<number>
|
|
16
|
+
loader?: {
|
|
17
|
+
default: {
|
|
18
|
+
color: Optional<string>,
|
|
19
|
+
accentColor: Optional<string>,
|
|
20
|
+
},
|
|
21
|
+
custom: Optional<string>
|
|
22
|
+
},
|
|
23
|
+
recycleStoriesList?: boolean,
|
|
24
|
+
closeOnLastSlideByTimer?: boolean,
|
|
25
|
+
sharePanel: {
|
|
26
|
+
targets: Array<SharePanelTargets>
|
|
27
|
+
copyButton?: {
|
|
28
|
+
svgSrc: {
|
|
29
|
+
baseState: string,
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
downloadButton?: {
|
|
33
|
+
svgSrc: {
|
|
34
|
+
baseState: string,
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
commonBackdrop?: {
|
|
39
|
+
color: Option<string>, // colorValue
|
|
40
|
+
backdropFilter: Option<string> // null or blur(3px)
|
|
41
|
+
},
|
|
42
|
+
slideBackdrop?: {
|
|
43
|
+
opacity: number, // .56
|
|
44
|
+
blur: number, // 30
|
|
45
|
+
linearGradientOverlay: Array<string> // ["rgba(0, 0, 0, 0.1) 0%", "rgba(0, 0, 0, 0.9) 100%"]
|
|
46
|
+
},
|
|
47
|
+
faviconApiUrl: string,
|
|
48
|
+
closeButton?: {
|
|
49
|
+
svgSrc: {
|
|
50
|
+
baseState: string
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
likeButton: {
|
|
54
|
+
svgSrc: {
|
|
55
|
+
baseState: string,
|
|
56
|
+
activeState: string,
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
dislikeButton: {
|
|
60
|
+
svgSrc: {
|
|
61
|
+
baseState: string,
|
|
62
|
+
activeState: string,
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
favoriteButton: {
|
|
66
|
+
svgSrc: {
|
|
67
|
+
baseState: string,
|
|
68
|
+
activeState: string,
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
muteButton: {
|
|
72
|
+
svgSrc: {
|
|
73
|
+
baseState: string,
|
|
74
|
+
activeState: string,
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
shareButton: {
|
|
78
|
+
svgSrc: {
|
|
79
|
+
baseState: string,
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
84
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type Nullable<T> = T | null;
|
|
2
|
-
type Optional<T> = T | null;
|
|
3
|
-
type Option<T> = T | null;
|
|
4
|
-
|
|
5
|
-
type Dict<K extends string | number | symbol = string, T = any> = Record<K, T>
|
|
6
|
-
|
|
7
|
-
type Brand<T, B extends string> = T & { readonly __brand: B }
|
|
1
|
+
type Nullable<T> = T | null;
|
|
2
|
+
type Optional<T> = T | null;
|
|
3
|
+
type Option<T> = T | null;
|
|
4
|
+
|
|
5
|
+
type Dict<K extends string | number | symbol = string, T = any> = Record<K, T>
|
|
6
|
+
|
|
7
|
+
type Brand<T, B extends string> = T & { readonly __brand: B }
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./appearance-manager";
|
|
2
|
-
export { StoryManager } from "./story-manager/StoryManager";
|
|
3
|
-
export { StoryListMain as StoryList } from "./story-list/StoryList";
|
|
4
|
-
export { UGCStoryListMain as UGCStoryList } from "./story-list/UGCStoryList";
|
|
5
|
-
export { StoryListViewModel } from "./story-list/storyListViewModel";
|
|
6
|
-
export { StoryListLoadStatus } from "./story-list/storyListLoadStatus";
|
|
1
|
+
export * from "./appearance-manager";
|
|
2
|
+
export { StoryManager } from "./story-manager/StoryManager";
|
|
3
|
+
export { StoryListMain as StoryList } from "./story-list/StoryList";
|
|
4
|
+
export { UGCStoryListMain as UGCStoryList } from "./story-list/UGCStoryList";
|
|
5
|
+
export { StoryListViewModel } from "./story-list/storyListViewModel";
|
|
6
|
+
export { StoryListLoadStatus } from "./story-list/storyListLoadStatus";
|
|
7
7
|
export { StoryManagerConfig } from "./story-manager/StoryManager.h";
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { AppearanceManager, StoryManager } from "..";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { AppearanceManager, StoryManager } from "..";
|
|
2
|
+
import { NavigationViewModel } from "./navigationViewModel";
|
|
3
|
+
import { StoryCardViewModel } from "./storyCardViewModel";
|
|
4
|
+
import { StoryListLoadStatus } from "./storyListLoadStatus";
|
|
5
|
+
import { StoryListViewModel } from "./storyListViewModel.d";
|
|
6
|
+
|
|
7
|
+
interface StoryListProps {
|
|
8
|
+
storyManager: StoryManager;
|
|
9
|
+
appearanceManager: AppearanceManager;
|
|
10
|
+
feedSlug: string;
|
|
11
|
+
testKey?: string;
|
|
12
|
+
ugcCardClickHandler?: () => void;
|
|
13
|
+
useUgcCard?: boolean;
|
|
14
|
+
onLoadStart?: () => void;
|
|
15
|
+
onLoadEnd?: (storyListLoadStatus: StoryListLoadStatus) => void;
|
|
16
|
+
viewModelExporter?: (storyListViewModel: StoryListViewModel) => void;
|
|
17
|
+
storyCardView?: (storyCard: StoryCardViewModel) => JSX.Element
|
|
18
|
+
navigationView?: (navigation: NavigationViewModel) => JSX.Element
|
|
19
|
+
}
|
|
16
20
|
export declare const StoryListMain: ({ storyManager, appearanceManager, feedSlug, useUgcCard, ugcCardClickHandler, viewModelExporter, onLoadStart, onLoadEnd }: StoryListProps) => JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AppearanceManager, StoryManager } from "..";
|
|
2
|
+
import { NavigationViewModel } from "./navigationViewModel";
|
|
3
|
+
import { StoryCardViewModel } from "./storyCardViewModel";
|
|
2
4
|
import { StoryListLoadStatus } from "./storyListLoadStatus";
|
|
3
5
|
import { StoryListViewModel } from "./storyListViewModel.d";
|
|
4
6
|
|
|
@@ -12,5 +14,7 @@ interface UGCStoryListProps {
|
|
|
12
14
|
onLoadStart?: () => void;
|
|
13
15
|
onLoadEnd?: (storyListLoadStatus: StoryListLoadStatus) => void;
|
|
14
16
|
viewModelExporter?: (storyListViewModel: StoryListViewModel) => void;
|
|
17
|
+
storyCardView?: (storyCard: StoryCardViewModel) => JSX.Element
|
|
18
|
+
navigationView?: (navigation: NavigationViewModel) => JSX.Element
|
|
15
19
|
}
|
|
16
20
|
export declare const UGCStoryListMain: ({ storyManager, appearanceManager, useUgcCard, filter, ugcCardClickHandler, viewModelExporter, onLoadStart, onLoadEnd }: UGCStoryListProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ViewModel } from "./viewModel";
|
|
2
|
+
|
|
3
|
+
export declare class NavigationViewModel extends ViewModel {
|
|
4
|
+
defaultStyles: Record<string, string>;
|
|
5
|
+
reachStart: boolean;
|
|
6
|
+
reachEnd: boolean;
|
|
7
|
+
onPrev(): void;
|
|
8
|
+
onNext(): void;
|
|
9
|
+
slider: {
|
|
10
|
+
currentPosition: number;
|
|
11
|
+
direction: "horizontal" | "vertical";
|
|
12
|
+
viewport: DOMRect;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StoriesListCardOptions } from "../appearance-manager";
|
|
2
|
+
import { ViewModel } from "./viewModel";
|
|
3
|
+
|
|
4
|
+
export declare class StoryCardViewModel extends ViewModel {
|
|
5
|
+
id: number;
|
|
6
|
+
title: string;
|
|
7
|
+
titleColor: string;
|
|
8
|
+
magazineName: string;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
background: {
|
|
11
|
+
color: string;
|
|
12
|
+
gradient: boolean;
|
|
13
|
+
};
|
|
14
|
+
favorite: boolean;
|
|
15
|
+
like: number;
|
|
16
|
+
deeplink: string | null;
|
|
17
|
+
hideInReader: boolean | null;
|
|
18
|
+
gameInstance?: { id?: string };
|
|
19
|
+
hasAudio: Nullable<boolean>;
|
|
20
|
+
favoriteCell: boolean;
|
|
21
|
+
ugcCardCell: boolean;
|
|
22
|
+
isOpened: boolean;
|
|
23
|
+
videoCoverSrc: Nullable<string>;
|
|
24
|
+
|
|
25
|
+
get options(): StoriesListCardOptions;
|
|
26
|
+
get isTitleCardInner(): boolean;
|
|
27
|
+
get isTitleCardOutsideTop(): boolean;
|
|
28
|
+
get isTitleCardOutsideBottom(): boolean;
|
|
29
|
+
get aspectRatio(): number;
|
|
30
|
+
|
|
31
|
+
getFavoriteImage(): { src?: string; color: string };
|
|
32
|
+
getImageSrc(): string | undefined;
|
|
33
|
+
onClick(): void;
|
|
34
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface StoryListLoadStatus {
|
|
2
|
-
feed: string | number,
|
|
3
|
-
filter: Record<string, any> | null,
|
|
4
|
-
defaultListLength: number,
|
|
5
|
-
favoriteListLength: number,
|
|
6
|
-
success: boolean,
|
|
7
|
-
error: {
|
|
8
|
-
name: string,
|
|
9
|
-
networkStatus: number,
|
|
10
|
-
networkMessage: string
|
|
11
|
-
} | null
|
|
1
|
+
export interface StoryListLoadStatus {
|
|
2
|
+
feed: string | number,
|
|
3
|
+
filter: Record<string, any> | null,
|
|
4
|
+
defaultListLength: number,
|
|
5
|
+
favoriteListLength: number,
|
|
6
|
+
success: boolean,
|
|
7
|
+
error: {
|
|
8
|
+
name: string,
|
|
9
|
+
networkStatus: number,
|
|
10
|
+
networkMessage: string
|
|
11
|
+
} | null
|
|
12
12
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { StoriesListOptions } from "../appearance-manager/storiesList";
|
|
2
|
-
import { ViewModel } from "./viewModel";
|
|
3
|
-
|
|
4
|
-
export declare class StoryListViewModel extends ViewModel {
|
|
5
|
-
stories: any[];
|
|
6
|
-
get isLoading(): boolean;
|
|
7
|
-
set modeDesktop(value: boolean);
|
|
8
|
-
get modeDesktop(): boolean;
|
|
9
|
-
set session(session: any | null);
|
|
10
|
-
get session(): any | null;
|
|
11
|
-
favoriteStoryImages: {
|
|
12
|
-
src: string | undefined;
|
|
13
|
-
color: string;
|
|
14
|
-
}[];
|
|
15
|
-
constructor();
|
|
16
|
-
get cardOptions(): any;
|
|
17
|
-
get options(): StoriesListOptions;
|
|
18
|
-
get isTitleCardInner(): boolean;
|
|
19
|
-
get isTitleCardOutsideTop(): boolean;
|
|
20
|
-
get isTitleCardOutsideBottom(): boolean;
|
|
21
|
-
get cardAspectRatio(): number;
|
|
22
|
-
onStoryClick(story: any, index: number): void;
|
|
23
|
-
destroy(): void;
|
|
24
|
-
getImageSrcByStory(story: any): string | undefined;
|
|
25
|
-
setOptions(options: StoriesListOptions): void;
|
|
26
|
-
reload(): void;
|
|
27
|
-
}
|
|
1
|
+
import { StoriesListOptions } from "../appearance-manager/storiesList";
|
|
2
|
+
import { ViewModel } from "./viewModel";
|
|
3
|
+
|
|
4
|
+
export declare class StoryListViewModel extends ViewModel {
|
|
5
|
+
stories: any[];
|
|
6
|
+
get isLoading(): boolean;
|
|
7
|
+
set modeDesktop(value: boolean);
|
|
8
|
+
get modeDesktop(): boolean;
|
|
9
|
+
set session(session: any | null);
|
|
10
|
+
get session(): any | null;
|
|
11
|
+
favoriteStoryImages: {
|
|
12
|
+
src: string | undefined;
|
|
13
|
+
color: string;
|
|
14
|
+
}[];
|
|
15
|
+
constructor();
|
|
16
|
+
get cardOptions(): any;
|
|
17
|
+
get options(): StoriesListOptions;
|
|
18
|
+
get isTitleCardInner(): boolean;
|
|
19
|
+
get isTitleCardOutsideTop(): boolean;
|
|
20
|
+
get isTitleCardOutsideBottom(): boolean;
|
|
21
|
+
get cardAspectRatio(): number;
|
|
22
|
+
onStoryClick(story: any, index: number): void;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
getImageSrcByStory(story: any): string | undefined;
|
|
25
|
+
setOptions(options: StoriesListOptions): void;
|
|
26
|
+
reload(): void;
|
|
27
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
export declare abstract class ViewModel extends EventEmitter {
|
|
4
|
-
destroy(): void;
|
|
5
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
export declare abstract class ViewModel extends EventEmitter {
|
|
4
|
+
destroy(): void;
|
|
5
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from "events";
|
|
3
|
-
import { AppearanceManager, StoryListViewModel, StoryManagerConfig } from "..";
|
|
4
|
-
|
|
5
|
-
export type IdentityFields = {
|
|
6
|
-
feedSlug: string;
|
|
7
|
-
filter?: Record<string, any>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export declare class StoryManager extends EventEmitter {
|
|
11
|
-
static instance: StoryManager;
|
|
12
|
-
constructor(storyManagerConfig: StoryManagerConfig);
|
|
13
|
-
destroy(): void;
|
|
14
|
-
set storyLinkClickHandler(callback: Function);
|
|
15
|
-
set openGoodsWidgetHandler(callback: (skuList: Array<Dict>) => Promise<Array<Dict>>);
|
|
16
|
-
get openGoodsWidgetHandler(): (skuList: Array<Dict>) => Promise<Array<Dict>>;
|
|
17
|
-
static getInstance(): StoryManager | null;
|
|
18
|
-
createStoryListViewModel({ appearanceManager, ...params }: {
|
|
19
|
-
identityFields: IdentityFields;
|
|
20
|
-
appearanceManager: AppearanceManager;
|
|
21
|
-
useUgcCard: boolean;
|
|
22
|
-
ugcCardClickHandler?: () => void;
|
|
23
|
-
}): StoryListViewModel;
|
|
24
|
-
setTags(tags: Array<string>): void;
|
|
25
|
-
setUserId(userId: string | number): void;
|
|
26
|
-
setLang(lang: "ru" | "en"): void;
|
|
27
|
-
setPlaceholders(placeholders: Dict<string, string>): void;
|
|
28
|
-
setImagePlaceholders(imagePlaceholders: Dict<string, string>): void;
|
|
29
|
-
showOnboardingStories(appearanceManager: AppearanceManager, options?: {
|
|
30
|
-
feed?: Option<string>;
|
|
31
|
-
customTags?: Array<string>;
|
|
32
|
-
limit?: Option<number>;
|
|
33
|
-
}): Promise<boolean>;
|
|
34
|
-
showStory(id: number | string, appearanceManager: AppearanceManager, ref?: string): Promise<boolean>;
|
|
35
|
-
openGame(gameInstanceId: string, appearanceManager: AppearanceManager, gameOptions?: { demoMode?: boolean }): Promise<void>;
|
|
36
|
-
closeGame(): Promise<boolean>;
|
|
37
|
-
closeStoryReader(): Promise<false | undefined>;
|
|
38
|
-
closeGoodsWidget(): void;
|
|
39
|
-
onBeforeStoryReaderOpen: Option<() => void>;
|
|
40
|
-
onBeforeFavoriteReaderOpen: Option<() => void>;
|
|
41
|
-
onStoryReaderClosed: Option<() => void>;
|
|
42
|
-
onFavoriteReaderClosed: Option<() => void>;
|
|
43
|
-
get sdkVersionName(): string;
|
|
44
|
-
get sdkVersionCode(): number;
|
|
45
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
import { AppearanceManager, StoryListViewModel, StoryManagerConfig } from "..";
|
|
4
|
+
|
|
5
|
+
export type IdentityFields = {
|
|
6
|
+
feedSlug: string;
|
|
7
|
+
filter?: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export declare class StoryManager extends EventEmitter {
|
|
11
|
+
static instance: StoryManager;
|
|
12
|
+
constructor(storyManagerConfig: StoryManagerConfig);
|
|
13
|
+
destroy(): void;
|
|
14
|
+
set storyLinkClickHandler(callback: Function);
|
|
15
|
+
set openGoodsWidgetHandler(callback: (skuList: Array<Dict>) => Promise<Array<Dict>>);
|
|
16
|
+
get openGoodsWidgetHandler(): (skuList: Array<Dict>) => Promise<Array<Dict>>;
|
|
17
|
+
static getInstance(): StoryManager | null;
|
|
18
|
+
createStoryListViewModel({ appearanceManager, ...params }: {
|
|
19
|
+
identityFields: IdentityFields;
|
|
20
|
+
appearanceManager: AppearanceManager;
|
|
21
|
+
useUgcCard: boolean;
|
|
22
|
+
ugcCardClickHandler?: () => void;
|
|
23
|
+
}): StoryListViewModel;
|
|
24
|
+
setTags(tags: Array<string>): void;
|
|
25
|
+
setUserId(userId: string | number): void;
|
|
26
|
+
setLang(lang: "ru" | "en"): void;
|
|
27
|
+
setPlaceholders(placeholders: Dict<string, string>): void;
|
|
28
|
+
setImagePlaceholders(imagePlaceholders: Dict<string, string>): void;
|
|
29
|
+
showOnboardingStories(appearanceManager: AppearanceManager, options?: {
|
|
30
|
+
feed?: Option<string>;
|
|
31
|
+
customTags?: Array<string>;
|
|
32
|
+
limit?: Option<number>;
|
|
33
|
+
}): Promise<boolean>;
|
|
34
|
+
showStory(id: number | string, appearanceManager: AppearanceManager, ref?: string): Promise<boolean>;
|
|
35
|
+
openGame(gameInstanceId: string, appearanceManager: AppearanceManager, gameOptions?: { demoMode?: boolean }): Promise<void>;
|
|
36
|
+
closeGame(): Promise<boolean>;
|
|
37
|
+
closeStoryReader(): Promise<false | undefined>;
|
|
38
|
+
closeGoodsWidget(): void;
|
|
39
|
+
onBeforeStoryReaderOpen: Option<() => void>;
|
|
40
|
+
onBeforeFavoriteReaderOpen: Option<() => void>;
|
|
41
|
+
onStoryReaderClosed: Option<() => void>;
|
|
42
|
+
onFavoriteReaderClosed: Option<() => void>;
|
|
43
|
+
get sdkVersionName(): string;
|
|
44
|
+
get sdkVersionCode(): number;
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inappstory/react-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "React SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"@emotion/styled": "^11.11.0",
|
|
33
33
|
"bowser": "^2.4.0",
|
|
34
34
|
"classnames": "^2.5.1",
|
|
35
|
-
"css-font-parser": "^2.0.0",
|
|
36
35
|
"effector": "^22.1.2",
|
|
37
36
|
"lodash": "^4.17.21",
|
|
38
37
|
"parse-css-sides": "^3.0.1",
|
|
@@ -43,15 +42,7 @@
|
|
|
43
42
|
"react-dom": ">=17.0.2"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "set NODE_OPTIONS=--openssl-legacy-provider && webpack -c config/webpack/prod.js",
|
|
48
|
-
"build:types": "tsc --project ./tsconfig.build.json && tsc-alias --debug -p ./tsconfig.build.json",
|
|
49
|
-
"analyze": "webpack --analyze -c config/webpack/analyze.js",
|
|
50
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
51
|
-
"prettier": "prettier src --write",
|
|
52
|
-
"prettier:check": "prettier src --check",
|
|
53
|
-
"postbuild": "cp -r ./src/types-new ./dist/types"
|
|
54
|
-
},
|
|
45
|
+
"scripts": {},
|
|
55
46
|
"browserslist": [
|
|
56
47
|
"Android >= 5",
|
|
57
48
|
"IOS >= 11",
|
|
@@ -60,4 +51,4 @@
|
|
|
60
51
|
"Firefox >= 31",
|
|
61
52
|
"Samsung >= 5"
|
|
62
53
|
]
|
|
63
|
-
}
|
|
54
|
+
}
|