You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.3 KiB

//
// MOBFJSContext.h
// MOBFoundation
//
// Created by 冯 鸿杰 on 15/2/27.
// Copyright (c) 2015年 MOB. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MOBFJSTypeDefine.h"
@class JSContext;
/**
* JavaScript上下文环境
*/
@interface MOBFJSContext : NSObject
/**
*
*
* @return JS上下文环境
*/
+ (instancetype)defaultContext;
/**
@param context JS上下文
@return JS上下文
*/
- (instancetype)initWithContext:(JSContext *)context;
/**
*
*
* @param name
* @param block
*/
- (void)registerJSMethod:(NSString *)name block:(MOBFJSMethodIMP)block;
/**
*
*
* @param name
* @param arguments
*
* @return
*/
- (NSString *)callJSMethod:(NSString *)name arguments:(NSArray *)arguments;
/**
*
*
* @param path
* @param name
*/
- (void)loadPluginWithPath:(NSString *)path forName:(NSString *)name;
/**
*
*
* @param content
* @param name
*/
- (void)loadPlugin:(NSString *)content forName:(NSString *)name;
/**
*
*
* @param script
*/
- (void)runScript:(NSString *)script;
@end