File tree Expand file tree Collapse file tree 10 files changed +596
-376
lines changed Expand file tree Collapse file tree 10 files changed +596
-376
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ export interface Line {
33 /** 行のid */ id : LineId ;
44 /** 行のテキスト */ text : string ;
55 /** 一番最後に行を編集した人のid */ userId : UserId ;
6- /** 行の作成日時 */ created : number ;
7- /** 行の最終更新日時 */ updated : number ;
6+ /** 行の作成日時 */ created : UnixTime ;
7+ /** 行の最終更新日時 */ updated : UnixTime ;
88}
99
1010/** basic information about a page */
@@ -20,8 +20,8 @@ export interface Page {
2020 * the maximum number of lines is 5.
2121 */
2222 descriptions : string [ ] ;
23- /** ページの最終更新日時 */ updated : number ;
24- /** Date last visitedに使われる最終アクセス日時 */ accessed : number ;
23+ /** ページの最終更新日時 */ updated : UnixTime ;
24+ /** Date last visitedに使われる最終アクセス日時 */ accessed : UnixTime ;
2525}
2626
2727/** the user id */
@@ -41,3 +41,5 @@ export type ProjectId = string;
4141 * - UPPER CASE -> upper_case
4242 */
4343export type StringLc = string ;
44+ /** UNIX time */
45+ export type UnixTime = number ;
Original file line number Diff line number Diff line change 1- import { Node , NodeWithoutIndent } from "./nodes.ts" ;
2- import { Line } from ". ./base.ts" ;
1+ import type { Node , NodeWithoutIndent } from "./nodes.ts" ;
2+ import type { Line as LineBase } from "./base.ts" ;
33
4- export type ParsedLine =
5- & Line
4+ export type Line =
5+ & LineBase
66 & {
77 section : {
8+ /** section number */
89 number : number ;
10+ /** section開始行なら`true` */
911 start : boolean ;
12+ /** section終了行なら`true` */
1013 end : boolean ;
1114 } ;
1215 }
1316 & ( {
14- title ?: boolean ;
17+ /** タイトル行だったときのみ生える */
18+ title ?: true ;
1519 } | {
1620 codeBlock : CodeBlock ;
1721 } | {
@@ -21,12 +25,15 @@ export type ParsedLine =
2125 } | {
2226 cli : Cli ;
2327 } | {
28+ /** 番号付きリストのときのみ生える */
29+ numberList ?: {
30+ /** 番号の長さ */
31+ digit : number ;
32+ } ;
33+ /** 数式を含む行のときのみ生える */
2434 formulaLine ?: true ;
25- nodes : NodeWithoutIndent [ ] ;
26- } | {
27- numberList ?: { digit : number } ;
28- formulaLine ?: true ;
29- nodes : Node [ ] ;
35+ /** 中に含まれるnodes */
36+ nodes : Node | NodeWithoutIndent [ ] ;
3037 } ) ;
3138
3239/** the type which represents a line in a block */
@@ -47,11 +54,17 @@ export interface TableBlock extends Block {
4754 /** the title of the table block */ title : string ;
4855 /** cells included in the present line */ cells : string [ ] ;
4956}
50- export type Helpfeel = {
57+
58+ /** Helpfeel記法 */
59+ export interface Helpfeel {
5160 prefix : "?" ;
61+ /** Helpfeel本文 */
5262 entry : string ;
53- } ;
54- export type Cli = {
63+ }
64+
65+ /** Command Line記法 */
66+ export interface Cli {
5567 prefix : "$" | "%" ;
68+ /** Command Line本文 */
5669 command : string ;
57- } ;
70+ }
Original file line number Diff line number Diff line change 1- /** Scrapbox REST APIが返すエラーの型 */
1+ /** Scrapbox REST APIが返すエラーの型
2+ *
3+ * `name`はないことがある
4+ */
25export interface ErrorLike {
36 /** error name */ name : string ;
47 /** error message */ message : string ;
@@ -22,8 +25,10 @@ export interface NotPrivilegeError extends ErrorLike {
2225/** Loginが必要なAPIをloginせずに叩いたときに発生するエラー */
2326export interface NotLoggedInError extends ErrorLike {
2427 name : "NotLoggedInError" ;
25- /** 詳細情報 */ details : {
26- /** 使用できるログイン方法 */ loginStrategies : (
28+ /** 詳細情報 */
29+ details : {
30+ /** 使用できるログイン方法 */
31+ loginStrategies : (
2732 | "google"
2833 | "github"
2934 | "microsoft"
Original file line number Diff line number Diff line change 1+ /** built-in UserScript events
2+ *
3+ * | Event | Description |
4+ * | ------ | ----------- |
5+ * | lines:changed | 今開いているページの文章が変更された |
6+ * | page:changed | 別のページに遷移した |
7+ * | layout:changed | 別の種類のページに遷移した |
8+ * | project:changed | 別のprojectに遷移した |
9+ */
10+ export type eventName =
11+ | "lines:changed"
12+ | "page:changed"
13+ | "layout:changed"
14+ | "project:changed" ;
Original file line number Diff line number Diff line change 1- export * from "./api/response.ts" ;
2- export * from "./api/error.ts" ;
3- export * from "./userscript.ts" ;
4- export * from "./userscript/blocks.ts" ;
5- export * from "./userscript/nodes.ts" ;
1+ export * from "./response.ts" ;
2+ export * from "./error.ts" ;
3+ export * from "./error.ts" ;
4+ export type { Scrapbox } from "./userscript.ts" ;
5+ import * as UserScript from "./userscript.ts" ;
6+ export { UserScript } ;
You can’t perform that action at this time.
0 commit comments