Skip to content

Commit b61019c

Browse files
authored
Merge pull request #30 from takker99/fix-lines
Feat: Add `Spotify` and `Anchor`
2 parents 535fdcb + 0562c74 commit b61019c

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

node/anchor.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Unit } from "./unit.ts";
2+
import { PlainText } from "./plainText.ts";
3+
4+
/** Anchor埋め込み */
5+
export interface Anchor {
6+
type: "anchor";
7+
8+
/** 構文解析結果 */
9+
unit: AnchorUnit;
10+
11+
/** the same as `unit.content` */
12+
children: PlainText;
13+
}
14+
15+
export interface AnchorUnit extends Unit {
16+
/** Anchor video ID */
17+
videoId: string;
18+
}

node/node.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import { Youtube } from "./youtube.ts";
1818
import { Vimeo } from "./vimeo.ts";
1919
import { Audio } from "./audio.ts";
2020
import { AudioLink } from "./audioLink.ts";
21+
import { Spotify } from "./spotify.ts";
22+
import { Anchor } from "./anchor.ts";
2123
import { GoogleMap } from "./googleMap.ts";
2224
import { Indent } from "./indent.ts";
2325

@@ -45,6 +47,8 @@ export type NodeWithoutIndent =
4547
| Video
4648
| Audio
4749
| AudioLink
50+
| Spotify
51+
| Anchor
4852
| Youtube
4953
| Vimeo
5054
| GoogleMap;

node/spotify.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Unit } from "./unit.ts";
2+
import { PlainText } from "./plainText.ts";
3+
4+
/** Spotify埋め込み */
5+
export interface Spotify {
6+
type: "spotify";
7+
8+
/** 構文解析結果 */
9+
unit: SpotifyUnit;
10+
11+
/** the same as `unit.content` */
12+
children: PlainText;
13+
}
14+
15+
export interface SpotifyUnit extends Unit {
16+
/** Spotify video ID */
17+
videoId: string;
18+
19+
params: SpotifyParams;
20+
}
21+
22+
export interface SpotifyParams {
23+
/** Spotifyのカテゴリ */
24+
type: "track" | "artist" | "playlist" | "album" | "episode" | "show";
25+
}

node/youtube.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { PlainText } from "./plainText.ts";
44
/** Youtube埋め込み */
55
export interface Youtube {
66
type: "youtube";
7+
78
/** 構文解析結果 */
89
unit: YoutubeUnit & (VideoId | ListId);
910

0 commit comments

Comments
 (0)