2019-07-26 14:19:42 +08:00
|
|
|
//
|
|
|
|
// DoricConstant.m
|
|
|
|
// Doric
|
|
|
|
//
|
|
|
|
// Created by pengfei.zhou on 2019/7/26.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "DoricConstant.h"
|
|
|
|
|
2019-07-27 10:33:38 +08:00
|
|
|
NSString * const DORIC_BUNDLE_SANDBOX = @"doric-sandbox";
|
|
|
|
NSString * const DORIC_BUNDLE_LIB = @"doric-lib";
|
2019-08-13 13:54:57 +08:00
|
|
|
NSString * const DORIC_MODULE_LIB = @"doric";
|
2019-07-26 14:19:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
NSString * const INJECT_LOG = @"nativeLog";
|
|
|
|
NSString * const INJECT_REQUIRE = @"nativeRequire";
|
|
|
|
NSString * const INJECT_TIMER_SET = @"nativeSetTimer";
|
|
|
|
NSString * const INJECT_TIMER_CLEAR = @"nativeClearTimer";
|
|
|
|
NSString * const INJECT_BRIDGE = @"nativeBridge";
|
|
|
|
|
|
|
|
NSString * const TEMPLATE_CONTEXT_CREATE = @"Reflect.apply("
|
|
|
|
"function(doric,context,Entry,require,exports){" "\n"
|
2019-07-27 10:33:38 +08:00
|
|
|
"%@" "\n"
|
|
|
|
"},doric.jsObtainContext(\"%@\"),["
|
2019-07-26 14:19:42 +08:00
|
|
|
"undefined,"
|
2019-07-27 10:33:38 +08:00
|
|
|
"doric.jsObtainContext(\"%@\"),"
|
|
|
|
"doric.jsObtainEntry(\"%@\"),"
|
2019-07-26 14:19:42 +08:00
|
|
|
"doric.__require__"
|
|
|
|
",{}"
|
|
|
|
"])";
|
|
|
|
|
|
|
|
NSString * const TEMPLATE_MODULE = @"Reflect.apply(doric.jsRegisterModule,this,["
|
2019-07-27 10:33:38 +08:00
|
|
|
"\"%@\","
|
2019-07-26 14:19:42 +08:00
|
|
|
"Reflect.apply(function(__module){"
|
|
|
|
"(function(module,exports,require){" "\n"
|
2019-07-27 10:33:38 +08:00
|
|
|
"%@" "\n"
|
2019-07-26 14:19:42 +08:00
|
|
|
"})(__module,__module.exports,doric.__require__);"
|
|
|
|
"\nreturn __module.exports;"
|
|
|
|
"},this,[{exports:{}}])"
|
|
|
|
"])";
|
|
|
|
|
2019-07-29 14:51:35 +08:00
|
|
|
NSString * const TEMPLATE_CONTEXT_DESTROY = @"doric.jsReleaseContext(\"%@\")";
|
2019-07-26 14:19:42 +08:00
|
|
|
|
|
|
|
NSString * const GLOBAL_DORIC = @"doric";
|
|
|
|
|
|
|
|
NSString * const DORIC_CONTEXT_RELEASE = @"jsReleaseContext";
|
|
|
|
|
|
|
|
NSString * const DORIC_CONTEXT_INVOKE = @"jsCallEntityMethod";
|
|
|
|
|
|
|
|
NSString * const DORIC_TIMER_CALLBACK = @"jsCallbackTimer";
|
|
|
|
|
|
|
|
NSString * const DORIC_BRIDGE_RESOLVE = @"jsCallResolve";
|
|
|
|
|
|
|
|
NSString * const DORIC_BRIDGE_REJECT = @"jsCallReject";
|
|
|
|
|
|
|
|
NSString * const DORIC_ENTITY_RESPONSE = @"__response__";
|