File tree Expand file tree Collapse file tree 3 files changed +15
-16
lines changed
Expand file tree Collapse file tree 3 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 22import {SvgIcon } from ' ../svg.ts' ;
33import {isPlainClick } from ' ../utils/dom.ts' ;
44import {shallowRef } from ' vue' ;
5- import {type createViewFileTreeStore } from ' ./ViewFileTreeStore.ts' ;
6-
7- export type Item = {
8- entryName: string ;
9- entryMode: ' blob' | ' exec' | ' tree' | ' commit' | ' symlink' | ' unknown' ;
10- entryIcon: string ;
11- entryIconOpen: string ;
12- fullPath: string ;
13- submoduleUrl? : string ;
14- children? : Item [];
15- };
5+ import type {createViewFileTreeStore , FileTreeItem } from ' ./ViewFileTreeStore.ts' ;
166
177const props = defineProps <{
18- item: Item ,
8+ item: FileTreeItem ,
199 store: ReturnType <typeof createViewFileTreeStore >
2010}>();
2111
Original file line number Diff line number Diff line change @@ -3,11 +3,20 @@ import {GET} from '../modules/fetch.ts';
33import { pathEscapeSegments } from '../utils/url.ts' ;
44import { createElementFromHTML } from '../utils/dom.ts' ;
55import { html } from '../utils/html.ts' ;
6- import type { Item } from './ViewFileTreeItem.vue' ;
6+
7+ export type FileTreeItem = {
8+ entryName : string ;
9+ entryMode : 'blob' | 'exec' | 'tree' | 'commit' | 'symlink' | 'unknown' ;
10+ entryIcon : string ;
11+ entryIconOpen : string ;
12+ fullPath : string ;
13+ submoduleUrl ?: string ;
14+ children ?: Array < FileTreeItem > ;
15+ } ;
716
817export function createViewFileTreeStore ( props : { repoLink : string , treePath : string , currentRefNameSubURL : string } ) {
918 const store = reactive ( {
10- rootFiles : [ ] as Array < Item > ,
19+ rootFiles : [ ] as Array < FileTreeItem > ,
1120 selectedItem : props . treePath ,
1221
1322 async loadChildren ( treePath : string , subPath : string = '' ) {
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ declare module '*.vue' {
1212 import type { DefineComponent } from 'vue' ;
1313 const component : DefineComponent < unknown , unknown , any > ;
1414 export default component ;
15- // List of named exports from vue components, used to make `tsc` output clean.
16- // To actually lint .vue files, `vue-tsc` is used because `tsc` can not parse them .
15+ // Here we declare all exports from vue files so `tsc` or `tsgo` can work for
16+ // non-vue files. To lint .vue files, `vue-tsc` must be used .
1717 export function initDashboardRepoList ( ) : void ;
1818 export function initRepositoryActionView ( ) : void ;
1919}
You can’t perform that action at this time.
0 commit comments