This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/iOS/Pod/Classes/Util/DoricConstant.m

83 lines
3.0 KiB
Mathematica
Raw Normal View History

2019-10-21 09:59:22 +08:00
/*
* Copyright [2019] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
2019-07-26 14:19:42 +08:00
//
// DoricConstant.m
// Doric
//
// Created by pengfei.zhou on 2019/7/26.
//
#import "DoricConstant.h"
2019-10-12 14:48:19 +08:00
NSString *const DORIC_BUNDLE_SANDBOX = @"doric-sandbox";
NSString *const DORIC_BUNDLE_LIB = @"doric-lib";
NSString *const DORIC_MODULE_LIB = @"doric";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +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 INJECT_EMPTY = @"nativeEmpty";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const TEMPLATE_CONTEXT_CREATE = @"Reflect.apply("
"function(doric,context,Entry,require,exports){" "\n"
"%@" "\n"
"},doric.jsObtainContext(\"%@\"),["
"undefined,"
"doric.jsObtainContext(\"%@\"),"
"doric.jsObtainEntry(\"%@\"),"
"doric.__require__"
",{}"
"])";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const TEMPLATE_MODULE = @"Reflect.apply(doric.jsRegisterModule,this,["
"\"%@\","
"Reflect.apply(function(__module){"
"(function(module,exports,require){" "\n"
"%@" "\n"
"})(__module,__module.exports,doric.__require__);"
"\nreturn __module.exports;"
"},this,[{exports:{}}])"
"])";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const TEMPLATE_CONTEXT_DESTROY = @"doric.jsReleaseContext(\"%@\")";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const GLOBAL_DORIC = @"doric";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_CONTEXT_RELEASE = @"jsReleaseContext";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_CONTEXT_INVOKE = @"jsCallEntityMethod";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_TIMER_CALLBACK = @"jsCallbackTimer";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_BRIDGE_RESOLVE = @"jsCallResolve";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_BRIDGE_REJECT = @"jsCallReject";
2019-07-26 14:19:42 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_ENTITY_RESPONSE = @"__response__";
2019-08-13 18:13:54 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_ENTITY_INIT = @"__init__";
2019-08-13 18:13:54 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_ENTITY_CREATE = @"__onCreate__";
2019-08-13 18:13:54 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_ENTITY_DESTROY = @"__onDestroy__";
2019-08-13 18:13:54 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_ENTITY_SHOW = @"__onShow__";
2019-08-13 18:13:54 +08:00
2019-10-12 14:48:19 +08:00
NSString *const DORIC_ENTITY_HIDDEN = @"__onHidden__";