1- import type { Page } from "@cosense/types/rest" ;
1+ import type { BaseLine } from "@cosense/types/rest" ;
22import type {
33 DeleteChange ,
44 InsertChange ,
@@ -10,7 +10,6 @@ import { diff, toExtendedChanges } from "../../deps/onp.ts";
1010import { countBodyIndent } from "./_codeBlock.ts" ;
1111import { push , type PushError , type PushOptions } from "./push.ts" ;
1212import type { Result } from "option-t/plain_result" ;
13- type Line = Page [ "lines" ] [ number ] ;
1413
1514/** コードブロックの上書きに使う情報のinterface */
1615export interface SimpleCodeFile {
@@ -74,7 +73,7 @@ export const updateCodeFile = (
7473 project ,
7574 title ,
7675 ( page ) => {
77- const lines : Line [ ] = page . lines ;
76+ const lines : BaseLine [ ] = page . lines ;
7877 const codeBlocks = getCodeBlocks ( { project, title, lines } , {
7978 filename : codeFile . filename ,
8079 } ) ;
@@ -104,7 +103,7 @@ export const updateCodeFile = (
104103/** TinyCodeBlocksの配列からコード本文をフラットな配列に格納して返す \
105104 * その際、コードブロックの左側に存在していたインデントは削除する
106105 */
107- const flatCodeBodies = ( codeBlocks : readonly TinyCodeBlock [ ] ) : Line [ ] => {
106+ const flatCodeBodies = ( codeBlocks : readonly TinyCodeBlock [ ] ) : BaseLine [ ] => {
108107 return codeBlocks . map ( ( block ) => {
109108 const indent = countBodyIndent ( block ) ;
110109 return block . bodyLines . map ( ( body ) => {
@@ -117,7 +116,7 @@ const flatCodeBodies = (codeBlocks: readonly TinyCodeBlock[]): Line[] => {
117116function * makeCommits (
118117 _codeBlocks : readonly TinyCodeBlock [ ] ,
119118 codeFile : SimpleCodeFile ,
120- lines : Line [ ] ,
119+ lines : BaseLine [ ] ,
121120 { userId, insertPositionIfNotExist, isInsertEmptyLineInTail } : {
122121 userId : string ;
123122 insertPositionIfNotExist : Required <
0 commit comments