Skip to content

Commit

Permalink
Fix type of render (eggjs#2155)
Browse files Browse the repository at this point in the history
  • Loading branch information
arniu authored and atian25 committed Mar 3, 2018
1 parent 6b1047e commit 951e236
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ interface ContextView { // tslint:disable-line
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
* @return {Promise<String>} result - return a promise with a render result
*/
render(name: string, locals: any, options?: any): Promise<string>;
render(name: string, locals?: any, options?: any): Promise<string>;

/**
* Render a template string by view engine
Expand All @@ -158,7 +158,7 @@ interface ContextView { // tslint:disable-line
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
* @return {Promise<String>} result - return a promise with a render result
*/
renderString(name: string, locals: any, options?: any): Promise<string>;
renderString(name: string, locals?: any, options?: any): Promise<string>;
}

export type LoggerLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'NONE';
Expand Down Expand Up @@ -752,7 +752,7 @@ export interface Context extends KoaApplication.Context {
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
* @return {Promise<String>} result - return a promise with a render result
*/
render(name: string, locals: any, options?: any): Promise<string>;
render(name: string, locals?: any, options?: any): Promise<string>;

/**
* Render a template string by view engine
Expand All @@ -761,7 +761,7 @@ export interface Context extends KoaApplication.Context {
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
* @return {Promise<String>} result - return a promise with a render result
*/
renderString(name: string, locals: any, options?: any): Promise<string>;
renderString(name: string, locals?: any, options?: any): Promise<string>;

__(key: string, ...values: string[]): string;
gettext(key: string, ...values: string[]): string;
Expand Down

0 comments on commit 951e236

Please sign in to comment.