-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
272 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ coverage/ | |
node_modules/ | ||
lib/ | ||
|
||
build/declarations/ | ||
build/docs/ | ||
.DS_Store | ||
npm-debug.log |
27 changes: 27 additions & 0 deletions
27
build/declarations/customStore/entityComponent/component.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Vector3, ITransformComponentData, IComponentData } from "./interfaces"; | ||
import { Entity } from "./entity"; | ||
import { EntityStore } from "../../stores"; | ||
export declare class Component { | ||
get id(): string; | ||
get name(): string; | ||
get gameobject(): Entity; | ||
get transform(): TransformComponent; | ||
protected get watchedData(): any; | ||
protected store: EntityStore; | ||
protected data: IComponentData; | ||
dataDefault: IComponentData; | ||
constructor(store: EntityStore, data: IComponentData); | ||
created(): void; | ||
deleted(): void; | ||
mounted(): void; | ||
unmounted(): void; | ||
enabled(): void; | ||
disabled(): void; | ||
} | ||
export declare class TransformComponent extends Component { | ||
get position(): Vector3; | ||
get rotation(): Vector3; | ||
get scale(): Vector3; | ||
data: ITransformComponentData; | ||
constructor(store: EntityStore, data: IComponentData); | ||
} |
22 changes: 22 additions & 0 deletions
22
build/declarations/customStore/entityComponent/entity.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { TransformComponent, Component } from "./component"; | ||
import { EntityStore } from "../../stores"; | ||
import { IEntityData } from "./interfaces"; | ||
export declare class Entity { | ||
get enable(): boolean; | ||
set enable(value: boolean); | ||
get id(): string; | ||
get name(): string; | ||
set name(value: string); | ||
get gameobject(): Entity; | ||
get transform(): TransformComponent; | ||
get parent(): Entity; | ||
get components(): Component[]; | ||
get childs(): Entity[]; | ||
protected get watchedData(): any; | ||
store: EntityStore; | ||
data: IEntityData; | ||
dataDefault: IEntityData; | ||
constructor(store: EntityStore, data: IEntityData); | ||
created(): void; | ||
deleted(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./interfaces"; | ||
export * from "./entity"; | ||
export * from "./component"; |
26 changes: 26 additions & 0 deletions
26
build/declarations/customStore/entityComponent/interfaces.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export interface IComponentData { | ||
id: string; | ||
parentId: string; | ||
enable: boolean; | ||
type: string; | ||
} | ||
export interface Vector3 { | ||
x: number; | ||
y: number; | ||
z: number; | ||
} | ||
export interface ITransformComponentData extends IComponentData { | ||
position: Vector3; | ||
rotation: Vector3; | ||
scale: Vector3; | ||
} | ||
export interface IEntityData { | ||
id: string; | ||
name: string; | ||
parentId: string; | ||
childIds: string[]; | ||
componentIds: { | ||
[id: string]: string; | ||
}; | ||
enable: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { EntityStore } from "../../stores"; | ||
import { IFileData } from "./interfaces"; | ||
export declare class EntityFile { | ||
get id(): string; | ||
get label(): string; | ||
set label(val: string); | ||
get icon(): string; | ||
set icon(val: string); | ||
get isFolder(): boolean; | ||
protected get watchedData(): any; | ||
protected store: EntityStore; | ||
protected data: IFileData; | ||
constructor(store: EntityStore, data: IFileData); | ||
setParent(parentId: string): void; | ||
created(): void; | ||
deleted(): void; | ||
toNestedJSON(): any; | ||
} |
11 changes: 11 additions & 0 deletions
11
build/declarations/customStore/fileFolder/entityFolder.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { EntityStore } from "../../stores"; | ||
import { IFolderData } from "./interfaces"; | ||
import { EntityFile } from "./entityFile"; | ||
export declare class EntityFolder extends EntityFile { | ||
get icon(): string; | ||
set icon(val: string); | ||
get isFolder(): boolean; | ||
protected data: IFolderData; | ||
constructor(store: EntityStore, data: IFolderData); | ||
toNestedJSON(): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./interfaces"; | ||
export * from "./entityFile"; | ||
export * from "./entityFolder"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export interface IFileData { | ||
parentId: string; | ||
id: string; | ||
label: string; | ||
icon: string; | ||
meta: { | ||
collapse?: boolean; | ||
hidden?: boolean; | ||
draggable?: boolean; | ||
}; | ||
} | ||
export interface IFolderData extends IFileData { | ||
childIds: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function pathWalk(obj: any, path: string): any; | ||
export declare function clone(obj: any): any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Kaaya } from "./kaaya"; | ||
export default Kaaya; | ||
export * from "./stores"; | ||
export * from "./customStore/entityComponent"; | ||
export * from "./customStore/fileFolder"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { BaseStore, KeyStore, TableStore, EntityStore } from "./stores"; | ||
export declare class Kaaya { | ||
/** | ||
* Create a Base Store (basic store without helpers or predefined structure) | ||
* | ||
* @param {*} [data={}] | ||
* @returns {BaseStore} | ||
*/ | ||
static createRawStore(data?: any): BaseStore; | ||
/** | ||
* Create a Keystore | ||
* | ||
* @param {*} [data={}] | ||
* @returns {KeyStore} | ||
*/ | ||
static createKeyStore(data?: any): KeyStore; | ||
/** | ||
* Create a Keystore from a configuration file (.json) | ||
* | ||
* @param {string} data | ||
* @memberof Kaaya | ||
*/ | ||
static createKeyStoreFromJSON(data: string): KeyStore; | ||
static createTableStore(data?: any): TableStore; | ||
static createTableStoreFromJSON(data: string): TableStore; | ||
static createEntityStore(data?: any): EntityStore; | ||
static createEntityComponentStore(data?: any): EntityStore; | ||
static createFileFolderStore(data?: any): EntityStore; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { DataStore } from "./dataStore"; | ||
export declare class BaseStore { | ||
get id(): string; | ||
get history(): any[]; | ||
get data(): any; | ||
get proxy(): any; | ||
get serialize(): any; | ||
protected _store: DataStore; | ||
protected _originalData: any; | ||
private _data; | ||
constructor(data?: any); | ||
addHookBefore(name: string, path: string, promise: (obj: any, mut: any) => Promise<void>): void; | ||
addHookAfter(name: string, path: string, promise: (obj: any, mut: any) => Promise<void>): void; | ||
transactionStart(meta?: any): void; | ||
transactionEnd(path?: string, meta?: any): void; | ||
observe(cb: (mut: any) => void): void; | ||
sync(history: any[]): void; | ||
syncAsync(history: any[]): Promise<void>; | ||
undo(): void; | ||
redo(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Event } from "coopa"; | ||
export declare class DataStore { | ||
evtCreate: Event<any>; | ||
evtApply: Event<any>; | ||
private hook; | ||
addHookBefore(name: string, path: string, promise: (obj: any, mut: any) => Promise<void>): void; | ||
addHookAfter(name: string, path: string, promise: (obj: any, mut: any) => Promise<void>): void; | ||
id: string; | ||
private mutations; | ||
private history; | ||
historyIds: Set<string>; | ||
private transactionMeta; | ||
private transactionHistory; | ||
private lastUndoIndex; | ||
private undoBuffer; | ||
private undoMap; | ||
get nextUndoId(): string | number; | ||
get nextRedoId(): string | number; | ||
constructor(); | ||
keepUndoObject(id: string, val: any): void; | ||
addHistory(mut: any, force?: boolean): void; | ||
transactionStart(meta?: any): void; | ||
transactionEnd(path: string, meta?: any): void; | ||
createMutation(name: string, path: string, data: any): any; | ||
registerMutation(name: string, cb: (obj: any, mut: any, forward?: boolean) => void): void; | ||
revertMutation(obj: any, mut: any): void; | ||
applyMutation(obj: any, mut: any): void; | ||
hookBefore(obj: any, mut: any): Promise<void>; | ||
hookAfter(obj: any, mut: any): Promise<void>; | ||
sync(obj: any, history: any[]): void; | ||
private syncCurrent; | ||
private syncQueue; | ||
syncAsyncExecute(obj: any, history: any[]): Promise<void>; | ||
syncAsync(obj: any, history: any[]): Promise<void>; | ||
getHistory(): any[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { BaseStore } from "./baseStore"; | ||
export declare class EntityStore extends BaseStore { | ||
factory: Map<string, (store: EntityStore, data: any) => any>; | ||
instances: WeakMap<any, any>; | ||
created: Set<string>; | ||
constructor(data?: any); | ||
register(name: string, factory: (store: EntityStore, data: any) => any): void; | ||
create(classname: string, data?: any): void; | ||
delete(id: string): void; | ||
getData(id: string, event?: boolean): any; | ||
getEntity<T>(id: string): T; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from "./baseStore"; | ||
export * from "./dataStore"; | ||
export * from "./entityStore"; | ||
export * from "./keyStore"; | ||
export * from "./tableStore"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { BaseStore } from "./baseStore"; | ||
export declare class KeyStore extends BaseStore { | ||
createSection(name: string): void; | ||
has(section: string, key: string): boolean; | ||
get(section: string, key: string, def?: string | number): any; | ||
set(section: string, key: string, value?: string | number): void; | ||
delete(section: string, key: string): void; | ||
deleteSection(name: string): void; | ||
stringify(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { BaseStore } from "./baseStore"; | ||
export interface ITableSheet { | ||
id: string; | ||
rows: string[]; | ||
values: any; | ||
} | ||
export declare class TableStore extends BaseStore { | ||
constructor(entries?: any); | ||
private getValues; | ||
getSheet(name: string): ITableSheet; | ||
createSheet(name: string, id?: string): void; | ||
getRows(sheet: string): unknown[]; | ||
getRowById(sheet: string, id: string): any; | ||
addRow(sheet: string, value: any): void; | ||
setRow(sheet: string, rowId: string, value: any): void; | ||
deleteRow(sheet: string, rowId: string): void; | ||
getCell(sheet: string, rowId: string, col: string): string | number | undefined; | ||
setCell(sheet: string, rowId: string, col: string, value?: string | number): void; | ||
deleteSheet(name: string): void; | ||
stringify(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters