Skip to content

ProtoSS Documentation

Ivo Yankulovski edited this page Dec 8, 2018 · 8 revisions

Author: Zeta Ret, Ivo Yankulovski
Zeta Ret ProtoSS

ProtoSS Class/Interface/Header Manager

Requires: protoss.all.js v1.04a
Version: 1.04c
Date: 2017 - Today

required*

ProtoSS

Properties

autoImplement Boolean
default true, resolveHeaders automatically implements interfaces using static headerImplement

autoSuper Boolean
default true, resolveHeaders automatically adds setSuper using static headerSuper

autoSuperList Boolean
default true, resolveHeaders automatically adds superList using static headerSuperList

autoSuperList2 Boolean
default true, resolveHeaders automatically adds superList2 using static headerSuperList2

errorData Object
default null, resolveHeaders outputs error data upon throwing an error

debug Function
default null, resolveHeaders calls debug("error", "resolveHeaders", o, o.errorData), where o=this

Methods

toInterface(Object i, Object pack) : Object

  • i* - Object, key-value map of interface definitions
  • pack - Object, pack obj to internal the interface

return Object, interface map

stringPattern(String pat, String str, Number pos) : Array

  • pat* - String, pattern to search in str string
  • str* - String, string to search in for patterns
  • pos - Number, initial position to start the search

return Array, 0 - number of patterns found; 1 - str without found patterns

getSuperCls(String sname, Object toppack, String path) : Function

  • sname* - String, super name split in pipes | to allow multiple super check
  • toppack* - Object, package object to search in
  • path - String, path used to append to found patterns of parent search /

return Function, first found reading left to right

resolveCls(Object s, Object toppack, String path) : ProtoSS

  • s* - Object, map of string classes to convert using getSuperCls
  • toppack - Object, pass var to getSuperCls
  • path - String, pass var to getSuperCls

return ProtoSS, current scope object

resolveHeaders(Object toppack, String path) : ProtoSS

  • toppack - Object, pass var to getSuperCls
  • path - String, pass var to getSuperCls

return ProtoSS, current scope object, resolves all headers from static properties

Static

Properties

headerImplement Array
default [], define implement inheritance using an [ProtoSS Class|classsupername string, super in strings/class] template

headerSuper Array
default [], define setSuper inheritance using an [ProtoSS Class|classsupername string, super in strings/class] template

headerSuperList Array
default [], define superList inheritance using an [ProtoSS Clas|classsupername strings, Array of supers in strings/class] template

headerSuperList2 Array
default [], define superList2 inheritance using an [ProtoSS Class|classsupername string, Array of supers in strings/class] template

stringmap Object
default {}, add dynamic string key-value pairs

Methods

eventProps(Object event, Array props) : Object

  • event* - Object, function object
  • props* - Array, string properties

return event, props attached as uppercase keys including _CHANGE property

staticProps(Object stat, Object props) : Object

  • stat* - Object, function object
  • props* - Object, key-value pairs attached to stat object

return stat, props attached as is

getDefinitionByName(String sname, Object toppack) : Function

  • sname* - String, class super name
  • toppack - Object, default is window
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.