From 8c40917cc2762a498cd2d35a4f4f69b01de3d672 Mon Sep 17 00:00:00 2001 From: rinsuki <428rinsuki+git@gmail.com> Date: Sun, 17 Jun 2018 19:55:39 +0900 Subject: [noImplicitAny: true] src/text --- src/text/parse/elements/mention.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/text/parse/elements/mention.ts') diff --git a/src/text/parse/elements/mention.ts b/src/text/parse/elements/mention.ts index 2ad2788300..a4140458d4 100644 --- a/src/text/parse/elements/mention.ts +++ b/src/text/parse/elements/mention.ts @@ -3,7 +3,14 @@ */ import parseAcct from '../../../acct/parse'; -module.exports = text => { +export type TextElementMention = { + type: "mention" + content: string + username: string + host: string +}; + +export default function(text: string) { const match = text.match(/^@[a-z0-9_]+(?:@[a-z0-9\.\-]+[a-z0-9])?/i); if (!match) return null; const mention = match[0]; @@ -13,5 +20,5 @@ module.exports = text => { content: mention, username, host - }; -}; + } as TextElementMention; +} -- cgit v1.2.3-freya