Skip to content

Commit 7ec90e7

Browse files
committed
added Utils class methods
1 parent 40f1194 commit 7ec90e7

File tree

3 files changed

+925
-1850
lines changed

3 files changed

+925
-1850
lines changed

index.d.ts

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
// Type definitions for contentstack 3.11.0
1+
// Type definitions for contentstack 3.12.0
22
// Project: https://www.contentstack.com/
33
// Definitions by: Contentstack <https://github.com/contentstack>
4+
import { EntryEmbedable, Option, RenderOption } from '@contentstack/utils'
5+
6+
// Utils
7+
export class Utils {
8+
static render(option: {
9+
entry: EntryEmbedable| EntryEmbedable[],
10+
renderOption?: RenderOption,
11+
paths?: string[]
12+
}): void;
13+
static renderContent(content: (string | string[]), option: Option): (string| string[]);
14+
}
415

516
//Enum for Contentstack Region
617
export enum Region {
@@ -119,32 +130,32 @@ export class Entry {
119130
cachePolicy: number;
120131
queryCachePolicy: number;
121132

122-
only(field_uid: string): Entry;
123-
only(field_uids: string[]): Entry;
124-
only(reference_field_uid:string, field_uid: string): Entry;
125-
only(reference_field_uid:string, field_uids: string[]): Entry;
126-
127-
except(field_uid: string): Entry;
128-
except(field_uids: string[]): Entry;
129-
except(reference_field_uid:string, field_uid: string): Entry;
130-
except(reference_field_uid:string, field_uids: string[]): Entry;
131-
132-
setCacheProvider(provider: object): Entry;
133-
setCachePolicy(policy: number): Entry;
134-
includeReference(val: string[]): Entry;
135-
includeReference(...val: string[]): Entry;
136-
language(language_code: string): Entry;
137-
addQuery(key: string, value: string): Entry;
138-
includeEmbeddedObjects(): Entry
133+
only(field_uid: string): this;
134+
only(field_uids: string[]): this;
135+
only(reference_field_uid:string, field_uid: string): this;
136+
only(reference_field_uid:string, field_uids: string[]): this;
137+
138+
except(field_uid: string): this;
139+
except(field_uids: string[]): this;
140+
except(reference_field_uid:string, field_uid: string): this;
141+
except(reference_field_uid:string, field_uids: string[]): this;
142+
143+
setCacheProvider(provider: object): this;
144+
setCachePolicy(policy: number): this;
145+
includeReference(val: string[]): this;
146+
includeReference(...val: string[]): this;
147+
language(language_code: string): this;
148+
addQuery(key: string, value: string): this;
149+
includeEmbeddedObjects(): this;
139150
/**
140151
* @deprecated since verion 3.3.0
141152
*/
142-
includeSchema(): Entry;
143-
includeReferenceContentTypeUID(): Entry;
144-
includeContentType(): Entry;
145-
includeOwner(): Entry;
146-
toJSON(): Entry;
147-
addParam(key: string, value: any): Entry;
153+
includeSchema(): this;
154+
includeReferenceContentTypeUID(): this;
155+
includeContentType(): this;
156+
includeOwner(): this;
157+
toJSON(): this;
158+
addParam(key: string, value: any): this;
148159
fetch(fetchOptions?: object): Promise<any>;
149160
}
150161

0 commit comments

Comments
 (0)