mirror of
https://github.com/esiur/esiur-js.git
synced 2026-03-18 15:30:38 +00:00
Generator
This commit is contained in:
32
src/esiur.js
32
src/esiur.js
@@ -6,7 +6,10 @@ import DistributedResource from './Net/IIP/DistributedResource.js'
|
||||
import MemoryStore from './Stores/MemoryStore.js';
|
||||
import IndexedDBStore from './Stores/IndexedDBStore.js';
|
||||
import IResource from './Resource/IResource.js';
|
||||
|
||||
import ResourceProxy from './Proxy/ResourceProxy.js';
|
||||
import TemplateGenerator from './Proxy/TemplateGenerator.js';
|
||||
|
||||
import DistributedConnection from './Net/IIP/DistributedConnection.js';
|
||||
import IIPAuthPacket from './Net/Packets/IIPAuthPacket.js';
|
||||
import IIPPacketCommand from './Net/Packets/IIPPacketCommand.js';
|
||||
@@ -84,12 +87,16 @@ import IPermissionsManager from './Security/Permissions/IPermissionsManager.js';
|
||||
import Ruling from './Security/Permissions/Ruling.js';
|
||||
|
||||
import { Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, Float32, Float64, Float128, Char16, Char8 } from './Data/ExtendedTypes.js';
|
||||
import Tuple from './Data/Tuple.js';
|
||||
import Nullable from './Data/Nullable.js';
|
||||
import Void from './Data/Void.js';
|
||||
|
||||
let namespace = {
|
||||
const namespace = {
|
||||
Core: { AsyncReply, AsyncException, AsyncQueue, ErrorType, ExceptionCode, IDestructible, IEventHandler, ProgressType},
|
||||
Data: {AutoList, AutoMap, BinaryList, Codec, DC, TypedList, TypedMap, Guid, IRecord, KeyList, NotModified,
|
||||
Data: {AutoList, AutoMap, BinaryList, Codec, DC, TypedList, TypedMap, Guid, IRecord, KeyList, NotModified, ResourceArrayType,
|
||||
PropertyValue, Record, ResourceArray, RepresentationType, RepresentationTypeIdentifier, TransmissionType, TransmissionTypeIdentifier,
|
||||
Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, Float32, Float64, Float128, Char16, Char8
|
||||
Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, Float32, Float64, Float128, Char16, Char8, Tuple,
|
||||
Nullable, Void
|
||||
},
|
||||
Net: {INetworkReceiver, NetworkBuffer, NetworkConnections, NetworkServer, NetworkSession, SendList,
|
||||
IIP: {DistributedConnection, DistributedPropertyContext, DistributedResource, DistributedResourceQueueItem,
|
||||
@@ -98,7 +105,7 @@ let namespace = {
|
||||
Sockets: {ISocket, SocketState, WSocket}
|
||||
|
||||
},
|
||||
Proxy: {ResourceProxy},
|
||||
Proxy: {ResourceProxy, TemplateGenerator},
|
||||
Resource: {CustomResourceEvent, Instance, IResource, IStore, Warehouse,
|
||||
Template: {
|
||||
ArgumentTemplate, EventTemplate, FunctionTemplate, MemberTemplate,
|
||||
@@ -115,8 +122,23 @@ let namespace = {
|
||||
Permissions: {ActionType, IPermissionsManager, Ruling},
|
||||
},
|
||||
Stores: {IndexedDBStore, MemoryStore},
|
||||
Generated: {},
|
||||
};
|
||||
|
||||
namespace.define = function(type, className) {
|
||||
let sc = className.split('.');
|
||||
let target = namespace.Generated;
|
||||
|
||||
for(let i = 0; i < sc.length; i++) {
|
||||
if (target[sc[i]] == undefined)
|
||||
target[sc[i]] = {};
|
||||
target = target[sc[i]];
|
||||
}
|
||||
|
||||
target[sc[sc.length - 1]] = type;
|
||||
}
|
||||
|
||||
|
||||
if (typeof window !== 'undefined')
|
||||
{
|
||||
window.wh = Warehouse;
|
||||
@@ -144,4 +166,4 @@ else if (typeof global !== 'undefined')
|
||||
global.Esiur = namespace;
|
||||
}
|
||||
|
||||
export default Warehouse;
|
||||
export default namespace;
|
||||
Reference in New Issue
Block a user