Skip to content

Commit

Permalink
Refactor long interfaces list into files. Introduced skeleton structu…
Browse files Browse the repository at this point in the history
…re for Picture Component and its interfaces. Ref. #4
  • Loading branch information
JoshStrobl committed Apr 6, 2016
1 parent 38b2a52 commit eeb3387
Show file tree
Hide file tree
Showing 31 changed files with 310 additions and 225 deletions.
133 changes: 74 additions & 59 deletions build/syiro.d.ts
Expand Up @@ -40,34 +40,6 @@ interface Screen {
onorientationchange: any;
onmozorientationchange: any;
}
interface ButtonPropertiesObject extends Object {
content?: string;
default?: boolean;
icon?: string;
image?: string;
items?: Array<any>;
list?: ComponentObject;
position?: Array<string>;
type?: string;
}
interface GridPropertiesObject extends Object {
columns?: number;
items: Array<GridItemPropertiesObject>;
}
interface GridItemPropertiesObject extends Object {
html?: any;
}
interface ListPropertiesObject extends Object {
header?: string;
items: Array<any>;
}
interface ListItemPropertiesObject extends Object {
control?: ComponentObject;
html?: any;
image?: string;
label?: string;
link?: LinkPropertiesObject;
}
interface MediaPlayerPropertiesObject extends Object {
artist?: string;
title?: string;
Expand All @@ -81,37 +53,6 @@ interface MediaPlayerPropertiesObject extends Object {
type?: "audio" | "video";
UsingExternalLibrary?: boolean;
}
interface NavbarPropertiesObject extends Object {
content?: string;
logo?: string;
fixed?: boolean;
items: Array<any>;
position?: "top" | "bottom";
}
interface SearchboxPropertiesObject extends Object {
content?: string;
DisableInputTrigger?: boolean;
handler?: Function;
listItemHandler?: Function;
preseed?: Array<string>;
suggestions?: boolean;
}
interface SidepanePropertiesObject extends Object {
items?: Array<any>;
logo?: string;
searchbox?: ComponentObject;
}
interface ToastPropertiesObject extends Object {
buttons?: Array<ToastButtonPropertiesObject>;
message: string;
title?: string;
type?: "dialog" | "normal";
}
interface ToastButtonPropertiesObject extends Object {
action?: "affirm" | "deny";
content?: string;
function?: Function;
}
declare namespace syiro.data {
var storage: Object;
function Manage(modificationType: string, keyList: string, data?: any): any;
Expand Down Expand Up @@ -198,20 +139,45 @@ declare namespace syiro.init {
function Sidepane(component: ComponentObject): void;
function Toast(component: ComponentObject): void;
}
interface GridPropertiesObject extends Object {
columns?: number;
items: Array<GridItemPropertiesObject>;
}
interface GridItemPropertiesObject extends Object {
html?: any;
}
declare module syiro.grid {
function New(properties: GridPropertiesObject): ComponentObject;
function Scale(component: ComponentObject): void;
}
declare module syiro.griditem {
function New(properties: GridItemPropertiesObject): ComponentObject;
}
interface NavbarPropertiesObject extends Object {
content?: string;
logo?: string;
fixed?: boolean;
items: Array<any>;
position?: "top" | "bottom";
}
declare namespace syiro.navbar {
function New(properties: NavbarPropertiesObject): ComponentObject;
function AddLink(append: string, component: ComponentObject, elementOrProperties: any): boolean;
function RemoveLink(component: ComponentObject, elementOrProperties: any): boolean;
function SetLogo(component: ComponentObject, content: string): boolean;
function SetLabel(component: ComponentObject, content: string): boolean;
}
interface ListPropertiesObject extends Object {
header?: string;
items: Array<any>;
}
interface ListItemPropertiesObject extends Object {
control?: ComponentObject;
html?: any;
image?: string;
label?: string;
link?: LinkPropertiesObject;
}
declare namespace syiro.list {
function New(properties: ListPropertiesObject): ComponentObject;
function SetHeader(component: ComponentObject, content: any): void;
Expand All @@ -226,24 +192,73 @@ declare namespace syiro.listitem {
function SetLabel(component: ComponentObject, content: string): boolean;
function SetLink(component: ComponentObject, properties: any): boolean;
}
interface PicturePropertiesObject extends Object {
default: string;
sources?: QuerySource[];
height?: string | number;
width?: string | number;
}
interface QuerySource {
mediaQuery: string;
source: string;
}
declare namespace syiro.picture {
function New(properties: PicturePropertiesObject): void;
function AddQuerySource(component: ComponentObject, querySource: QuerySource): void;
function RemoveQuerySource(component: ComponentObject, querySource: QuerySource): void;
}
interface SearchboxPropertiesObject extends Object {
content?: string;
DisableInputTrigger?: boolean;
handler?: Function;
listItemHandler?: Function;
preseed?: Array<string>;
suggestions?: boolean;
}
declare namespace syiro.searchbox {
function New(properties: SearchboxPropertiesObject): ComponentObject;
function Suggestions(...args: any[]): void;
function SetText(component: ComponentObject, content: any): void;
}
interface SidepanePropertiesObject extends Object {
items?: Array<any>;
logo?: string;
searchbox?: ComponentObject;
}
declare namespace syiro.sidepane {
function New(properties: SidepanePropertiesObject): ComponentObject;
function GestureInit(): void;
function Drag(): void;
function Release(): void;
function Toggle(component: ComponentObject, eventData?: any): void;
}
interface ToastPropertiesObject extends Object {
buttons?: Array<ToastButtonPropertiesObject>;
message: string;
title?: string;
type?: "dialog" | "normal";
}
interface ToastButtonPropertiesObject extends Object {
action?: "affirm" | "deny";
content?: string;
function?: Function;
}
declare namespace syiro.toast {
function New(properties: ToastPropertiesObject): ComponentObject;
function Clear(component: ComponentObject): void;
function ClearAll(): void;
function Toggle(component: ComponentObject, action?: string): void;
}
interface ButtonPropertiesObject extends Object {
content?: string;
default?: boolean;
icon?: string;
image?: string;
items?: Array<any>;
list?: ComponentObject;
position?: Array<string>;
type?: string;
}
declare namespace syiro.button {
function New(properties: ButtonPropertiesObject): ComponentObject;
function SetIcon(component: ComponentObject, content: string): boolean;
Expand Down
6 changes: 3 additions & 3 deletions build/syiro.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/syiro.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion src/typescript/animation.ts
Expand Up @@ -2,8 +2,8 @@
This is the namespace for animation in Syiro
*/

/// <reference path="interfaces/core.ts" />
/// <reference path="component.ts" />
/// <reference path="interfaces.ts" />

namespace syiro.animation {

Expand Down
2 changes: 1 addition & 1 deletion src/typescript/component.ts
Expand Up @@ -2,9 +2,9 @@
This is the namespace for core Syiro functionality.
*/

/// <reference path="interfaces/core.ts" />
/// <reference path="data.ts" />
/// <reference path="events.ts" />
/// <reference path="interfaces.ts" />
/// <reference path="render.ts" />

namespace syiro.component {
Expand Down
1 change: 1 addition & 0 deletions src/typescript/components/button.ts
Expand Up @@ -2,6 +2,7 @@
This is the namespace for the Syiro Button, Buttongroup, and Toggle Button components.
*/

/// <reference path="../interfaces/button.ts" />
/// <reference path="../component.ts" />
/// <reference path="../style.ts" />
/// <reference path="../utilities.ts" />
Expand Down
1 change: 1 addition & 0 deletions src/typescript/components/grid.ts
Expand Up @@ -2,6 +2,7 @@
This is the namespace for Syiro Grid component and it's sub-component, Grid Item
*/

/// <reference path="../interfaces/grid.ts" />
/// <reference path="../component.ts" />
/// <reference path="../style.ts" />
/// <reference path="../utilities.ts" />
Expand Down
1 change: 1 addition & 0 deletions src/typescript/components/list.ts
Expand Up @@ -2,6 +2,7 @@
This is the namespace for Syiro List component and it's sub-component, List Item
*/

/// <reference path="../interfaces/list.ts" />
/// <reference path="../component.ts" />
/// <reference path="../style.ts" />
/// <reference path="../utilities.ts" />
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/components/mediaplayer.ts
Expand Up @@ -2,9 +2,9 @@
This is a file containing the Media Player Component
*/

/// <reference path="../interfaces/mediaplayer.ts" />
/// <reference path="../component.ts" />
/// <reference path="../events.ts" />
/// <reference path="../interfaces.ts" />
/// <reference path="../style.ts" />
/// <reference path="../utilities.ts" />

Expand Down
1 change: 1 addition & 0 deletions src/typescript/components/navbar.ts
Expand Up @@ -2,6 +2,7 @@
This is the namespace for Syiro Navbar component (previously referred to as Header and Footer Components).
*/

/// <reference path="../interfaces/navbar.ts" />
/// <reference path="../component.ts" />
/// <reference path="../utilities.ts" />

Expand Down
27 changes: 27 additions & 0 deletions src/typescript/components/picture.ts
@@ -0,0 +1,27 @@
/*
This is the namespace for the Syiro Picture component.
*/
/// <reference path="../interfaces/picture.ts" />
/// <reference path="../component.ts" />
/// <reference path="../utilities.ts" />

namespace syiro.picture {

// New
// Create a Picture
export function New(properties : PicturePropertiesObject){

}

// AddQuerySource
// Add a QuerySource
export function AddQuerySource(component : ComponentObject, querySource : QuerySource){

}

// RemoveQuerySource
// Remove a QuerySource
export function RemoveQuerySource(component : ComponentObject, querySource : QuerySource){

}
}
1 change: 1 addition & 0 deletions src/typescript/components/searchbox.ts
Expand Up @@ -2,6 +2,7 @@
This is the namespace for Syiro Searchbox component.
*/

/// <reference path="../interfaces/searchbox.ts" />
/// <reference path="../component.ts" />
/// <reference path="../style.ts" />
/// <reference path="../utilities.ts" />
Expand Down
1 change: 1 addition & 0 deletions src/typescript/components/sidepane.ts
Expand Up @@ -2,6 +2,7 @@
This is the namespace for the Syiro Sidepane Component.
*/

/// <reference path="../interfaces/sidepane.ts" />
/// <reference path="../component.ts" />
/// <reference path="../style.ts" />
/// <reference path="../utilities.ts" />
Expand Down
1 change: 1 addition & 0 deletions src/typescript/components/toast.ts
Expand Up @@ -3,6 +3,7 @@
Contrary to common belief, this does not actually have anything to do with toast.
*/

/// <reference path="../interfaces/toast.ts" />
/// <reference path="../component.ts" />
/// <reference path="../style.ts" />
/// <reference path="../utilities.ts" />
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/data.ts
Expand Up @@ -2,7 +2,7 @@
This is the namespace for managing Syiro Data.
*/

/// <reference path="interfaces.ts" />
/// <reference path="interfaces/core.ts" />

namespace syiro.data {
export var storage : Object = { }; // Define syiro.data.storage as the storage Object for all Syiro Data
Expand Down
4 changes: 2 additions & 2 deletions src/typescript/device.ts
Expand Up @@ -2,9 +2,9 @@
This is the namespace for information and functionality Syiro provides regarding the device using Syiro.
*/

/// <reference path="events.ts" />
/// <reference path="interfaces.ts" />
/// <reference path="components/mediaplayer.ts" />
/// <reference path="interfaces/core.ts" />
/// <reference path="events.ts" />

namespace syiro.device {

Expand Down
2 changes: 1 addition & 1 deletion src/typescript/events.ts
Expand Up @@ -2,9 +2,9 @@
This is the namespace for Syiro Component and Generic Element Event Handling
*/

/// <reference path="interfaces/core.ts" />
/// <reference path="animation.ts" />
/// <reference path="component.ts" />
/// <reference path="interfaces.ts" />

namespace syiro.events {

Expand Down
4 changes: 2 additions & 2 deletions src/typescript/init.ts
Expand Up @@ -2,9 +2,9 @@
This is the namespace for Syiro's init system
*/

/// <reference path="component.ts" />
/// <reference path="components/mediaplayer.ts" />
/// <reference path="interfaces.ts" />
/// <reference path="interfaces/core.ts" />
/// <reference path="component.ts" />
/// <reference path="style.ts" />

namespace syiro.init {
Expand Down

0 comments on commit eeb3387

Please sign in to comment.