@ewizardjs/structure-api
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

StructureApi

Structure API is a set of separate functions for working with structure.json.

Installation:

npm i @ewizardjs/structure
Note: You can also use the api from ewizardjs

Usage:

In your .ts/js files:
import { getSlides, getFlatSlides, getVisibleSlides, getFlatVisibleSlides, getHiddenSlides, getFlatHiddenSlides, getArchivedSlides, getSlide, getChapters, getHiddenChapters, getChapter, getChapterSlides, getSlideSubslides, getStartSlide, getStoryboard, StructureApi, getStructureFileVersion, getVisibleChapters, getFlatSlide, } from '@ewizardjs/structure';

In your content (.vue files):
this.$structure.someMethod()

Note: in order to get the values in the thumbnail field when calling the corresponding methods, they need to pass a fragment of the systemSettings object

Data structures:

  • SlideType
    • type: string
    • values: visible, hidden, archived
  • ChapterType
    • type: string
    • values: visible, hidden
  • SlideTypes
    • type: Object
    • value: { visible: boolean; hidden: boolean; archived: boolean; }
  • ChapterTypes
    • type: Object
    • value: { visible: boolean; hidden: boolean; }
  • SlideData
    • type: Object
    • value: { id: string; name: string; chapter: string | undefined; type: SlideType; thumbnail?: string; template?: string; }
  • FlatSlideData
    • type: Object
    • value: { id: string; name: string; chapter: string | undefined; type: SlideType; thumbnail?: string; template?: string; isSubslide: boolean; parentSlide?: string; }
  • NestedSlideData
    • type: Object
    • value: { id: string; name: string; chapter: string | undefined; type: SlideType; thumbnail?: string; template?: string; subslides: SlideData[]; }
  • ChapterData
    • type: Object
    • value: { id: string; name: string; type: ChapterType; }
  • NestedChapterData
    • type: Object
    • value: { id: string; name: string; type: ChapterType; slides: NestedSlideData[]; }
  • SystemSettingsSlideFragment
    • type: Object
    • value: { path: { slides: string, slide: { thumbnail: string } } }
  • StartSlide
    • type: Object
    • value: { slide?: string; chapter?: string; }

Functions


  • getSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • slideTypes
        type: SlideTypes
        optional: true
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of NestedSlideData
  • getFlatSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • slideTypes
        type: SlideTypes
        optional: true
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of FlatSlideData
  • getVisibleSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of NestedSlideData
  • getFlatVisibleSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of FlatSlideData
  • getHiddenSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of NestedSlideData
  • getFlatHiddenSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of FlatSlideData
  • getArchivedSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of NestedSlideData
  • getSlide

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • slideId
        type: string
        optional: false
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Object,
      • value: NestedSlideData
  • getFlatSlide

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • slideId
        type: string
        optional: false
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Object,
      • value: FlatSlideData
  • getChapters

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • chapterTypes
        type: ChapterTypes
        optional: true
    • return
      • type: Array,
      • value: Array of ChapterData
  • getHiddenChapters

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
    • return
      • type: Array,
      • value: Array of ChapterData
  • getVisibleChapters

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
    • return
      • type: Array,
      • value: Array of ChapterData
  • getChapter

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • chapterId
        type: string
        optional: false
    • return
      • type: Object,
      • value: ChapterData
  • getChapterSlides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • chapterId
        type: string
        optional: false
      • slideTypes
        type: SlideTypes
        optional: true
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of SlideData
  • getSlideSubslides

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • slideId
        type: StructureV2.iStructureJSON,
        optional: false
      • slideTypes
        type: SlideTypes
        optional: true
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of SlideData
  • getStartSlide

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
    • return
      • type: Object,
      • value: StartSlide
  • getStoryboard

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
      • chapterTypes
        type: ChapterTypes
        optional: true
      • systemSettings
        type: SystemSettingsSlideFragment
        optional: true
    • return
      • type: Array,
      • value: Array of NestedChapterData
  • getStructureFileVersion

    • args:
      • structureJson
        type: StructureV2.iStructureJSON,
        optional: false
    • return
      • type: Number,
      • value: 1 or 2

Readme

Keywords

none

Package Sidebar

Install

npm i @ewizardjs/structure-api

Weekly Downloads

16

Version

0.1.6

License

ISC

Unpacked Size

88.1 kB

Total Files

17

Last publish

Collaborators

  • serhii_but
  • alexbelov
  • v.kobyletskiy
  • m.polevchuk
  • b.hryhoriev
  • ewizardjs-team
  • vasylshylov