diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-06-18 08:42:17 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-18 08:42:17 +0900 |
| commit | a766faeae9f5d5ea9be6f758ec446dbcd240a86e (patch) | |
| tree | e2ed5f30e2776259ef961c9f9a82412e7f9f66cd /src/text/parse/elements/link.ts | |
| parent | Merge pull request #1735 from rinsuki/fix/minor-fix-201806171721 (diff) | |
| parent | [noImplicitAny: true] src/services/drive (diff) | |
| download | sharkey-a766faeae9f5d5ea9be6f758ec446dbcd240a86e.tar.gz sharkey-a766faeae9f5d5ea9be6f758ec446dbcd240a86e.tar.bz2 sharkey-a766faeae9f5d5ea9be6f758ec446dbcd240a86e.zip | |
Merge pull request #1738 from rinsuki/features/ts-noimplicitany-true
[WIP] noImplicitAny: true
Diffstat (limited to 'src/text/parse/elements/link.ts')
| -rw-r--r-- | src/text/parse/elements/link.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/text/parse/elements/link.ts b/src/text/parse/elements/link.ts index 35563ddc3d..7e0d6f5cf8 100644 --- a/src/text/parse/elements/link.ts +++ b/src/text/parse/elements/link.ts @@ -2,7 +2,15 @@ * Link */ -module.exports = text => { +export type TextElementLink = { + type: "link" + content: string + title: string + url: string + silent: boolean +}; + +export default function(text: string) { const match = text.match(/^\??\[([^\[\]]+?)\]\((https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+?)\)/); if (!match) return null; const silent = text[0] == '?'; @@ -15,5 +23,5 @@ module.exports = text => { title: title, url: url, silent: silent - }; -}; + } as TextElementLink; +} |