You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
663 B
27 lines
663 B
import {hasOwnProperty} from '@extollo/lib'
|
|
|
|
export type MarkMark = {
|
|
frontmatter: FrontMatter,
|
|
sections: Section[],
|
|
}
|
|
|
|
export type FrontMatter = {
|
|
syntax: 'v1',
|
|
authorName?: string,
|
|
authorEmail?: string,
|
|
authorHref?: string,
|
|
}
|
|
|
|
export type AnonymousSection = { links: Link[] }
|
|
export type NamedSection = { title: string, description?: string, links: Link[] }
|
|
export type Section = AnonymousSection | NamedSection
|
|
|
|
export const isNamedSection = (what: Section): what is NamedSection =>
|
|
hasOwnProperty(what, 'title') && (typeof what.title === 'string')
|
|
|
|
export type Link = {
|
|
title: string,
|
|
tags: string[],
|
|
urls: string[],
|
|
}
|