Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export interface IStory {
  2.   id?: number;
  3.   background: {
  4.     color: string;
  5.     image?: {
  6.       height: number;
  7.       scale: number;
  8.       src?: string;
  9.       upload_id?: number;
  10.       width: number;
  11.       x: number;
  12.       y: number;
  13.     };
  14.     video?: unknown;
  15.   };
  16.   datetime: string;
  17.   link: string;
  18.   objects: Map<IStoryObject["id"], IStoryObject>;
  19.   page_config_id?: IEpPageconfig["id"];
  20.   result_image_upload_id?: string;
  21.   resut_thumb_upload_id?: string;
  22. }
  23.  
  24. export type IStoryObject =
  25.   | IStoryCountdown
  26.   | IStoryGif
  27.   | IStoryImage
  28.   | IStoryHashtag
  29.   | IStoryLocation
  30.   | IStoryMention
  31.   | IStoryPoll
  32.   | IStoryQuestion
  33.   | IStoryQuiz
  34.   | IStoryText;
  35.  
  36. export type IStoryObjectPreparing =
  37.   | Omit<IStoryCountdown, "id">
  38.   | Omit<IStoryGif, "id">
  39.   | Omit<IStoryImage, "id">
  40.   | Omit<IStoryHashtag, "id">
  41.   | Omit<IStoryLocation, "id">
  42.   | Omit<IStoryMention, "id">
  43.   | Omit<IStoryPoll, "id">
  44.   | Omit<IStoryQuestion, "id">
  45.   | Omit<IStoryQuiz, "id">
  46.   | Omit<IStoryText, "id">;
  47.  
  48. export interface IStoryObjectBase {
  49.   height: number;
  50.   id: string;
  51.   rotation: number;
  52.   type:
  53.     | "countdown"
  54.     | "gif"
  55.     | "image"
  56.     | "hashtag"
  57.     | "location"
  58.     | "mention"
  59.     | "poll"
  60.     | "question"
  61.     | "quiz"
  62.     | "text";
  63.   x: number;
  64.   y: number;
  65.   width: number;
  66. }
  67.  
  68. export interface IStoryCountdown extends IStoryObjectBase {
  69.   datetime: string;
  70.   fill_variant:
  71.     | "black"
  72.     | "blue"
  73.     | "green"
  74.     | "green_to_blue"
  75.     | "orange"
  76.     | "red"
  77.     | "red_to_orange"
  78.     | "violet"
  79.     | "violet_to_blue"
  80.     | "violet_to_red"
  81.     | "white"
  82.     | "yellow";
  83.   text: string;
  84.   type: "countdown";
  85. }
  86.  
  87. export interface IStoryGif extends IStoryObjectBase {
  88.   src_gif: string;
  89.   src_mp4: string;
  90.   type: "gif";
  91. }
  92.  
  93. export interface IStoryHashtag extends IStoryObjectBase {
  94.   fill_variant: "classic" | "color" | "transparent";
  95.   text: string;
  96.   type: "hashtag";
  97. }
  98.  
  99. export interface IStoryImage extends IStoryObjectBase {
  100.   src?: string;
  101.   upload_id?: number;
  102.   type: "image";
  103. }
  104.  
  105. export interface IStoryLocation extends IStoryObjectBase {
  106.   fill_variant: "classic" | "color" | "transparent";
  107.   place: IInstagramPlace;
  108.   type: "location";
  109. }
  110.  
  111. export interface IStoryMention extends IStoryObjectBase {
  112.   fill_variant: "classic" | "color" | "transparent";
  113.   user: IInstagramUser;
  114.   type: "mention";
  115. }
  116.  
  117. export interface IStoryPoll extends IStoryObjectBase {
  118.   answer_negative: string;
  119.   answer_positive: string;
  120.   text: string;
  121.   type: "poll";
  122. }
  123.  
  124. export interface IStoryQuestion extends IStoryObjectBase {
  125.   fill_variant:
  126.     | "black"
  127.     | "blue"
  128.     | "green"
  129.     | "orange"
  130.     | "red"
  131.     | "rose"
  132.     | "violet"
  133.     | "white"
  134.     | "yellow";
  135.   text: string;
  136.   type: "question";
  137. }
  138.  
  139. export interface IStoryQuiz extends IStoryObjectBase {
  140.   answers: { text: string; isCorrect: boolean }[];
  141.   fill_variant:
  142.     | "black"
  143.     | "blue"
  144.     | "green"
  145.     | "green_to_blue"
  146.     | "orange"
  147.     | "red"
  148.     | "red_to_orange"
  149.     | "violet"
  150.     | "violet_to_blue"
  151.     | "violet_to_red"
  152.     | "yellow";
  153.   text: string;
  154.   type: "quiz";
  155. }
  156.  
  157. export interface IStoryText extends IStoryObjectBase {
  158.   align: "center" | "left" | "right";
  159.   effect: "" | "glow" | "shadow";
  160.   fill: string;
  161.   font_family: string;
  162.   font_size: number;
  163.   font_style: string;
  164.   line_height: number;
  165.   text: string;
  166.   type: "text";
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement