Skip to content

Commit ef90a55

Browse files
committed
Added Page#rawContent to definitions (dijs#153)
1 parent c6edf00 commit ef90a55

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

index.d.ts

+13-5
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ declare module 'wikijs' {
194194
*/
195195
mainImage(): Promise<string>;
196196

197+
/**
198+
* Raw content from page
199+
*
200+
* @returns {Promise<string>}
201+
* @memberof Page
202+
*/
203+
rawContent(): Promise<string>;
204+
197205
/**
198206
* Raw data from images from page
199207
*
@@ -340,11 +348,11 @@ declare module 'wikijs' {
340348
*/
341349
mostViewed(): Promise<{ title: string; count: number }[]>;
342350

343-
/**
344-
* Fetch all page titles in wiki
345-
* @method Wiki#allPages
346-
* @return {Promise<string[]>} Array of pages
347-
*/
351+
/**
352+
* Fetch all page titles in wiki
353+
* @method Wiki#allPages
354+
* @return {Promise<string[]>} Array of pages
355+
*/
348356
allPages(): Promise<string[]>;
349357

350358
/**

test/real.js

+11
Original file line numberDiff line numberDiff line change
@@ -437,4 +437,15 @@ describe('Live tests', () => {
437437
refs.length.should.equal(140);
438438
});
439439
});
440+
441+
it('should allow calling rawContent #153', () => {
442+
this.timeout(timeoutTime);
443+
return wiki()
444+
.find('Alphabet')
445+
.then(page => {
446+
page.rawContent().then(rawContent => {
447+
rawContent.length.should.equal(10);
448+
})
449+
});
450+
});
440451
});

0 commit comments

Comments
 (0)