Feedback from code review

This commit is contained in:
Matt Lewis
2017-12-28 10:19:23 +00:00
parent f15552392a
commit 4915b60732
2 changed files with 17 additions and 1 deletions
+14 -1
View File
@@ -113,6 +113,19 @@ export declare function convertUnicodeIndices(text: string, entities: EntityWith
export declare function hitHighlight(text: string, hits?: number[][], options?: { tag: string }): string;
export interface ParseTweetOptions {
version?: number;
maxWeightedTweetLength?: number;
scale?: number;
defaultWeight?: number;
transformedURLLength?: number;
ranges?: Array<{
start: number;
end: number;
weight: number;
}>;
}
export interface ParsedTweet {
weightedLength: number;
permillage: number;
@@ -123,4 +136,4 @@ export interface ParsedTweet {
validRangeStart: number;
}
export declare function parseTweet(text: string): ParsedTweet;
export declare function parseTweet(text: string, options?: ParseTweetOptions): ParsedTweet;
+3
View File
@@ -60,3 +60,6 @@ const linked: string = twitter.autoLink("link @user, and expand url... http://t.
]});
const usernames: string[] = twitter.extractMentions("Mentioning @twitter and @jack");
const tweet = twitter.parseTweet('foo');
const tweetWithOptions = twitter.parseTweet('foo', {maxWeightedTweetLength: 140});