@chisquare-tech/origine-ngx-apps-code 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,928 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+ import { ActivatedRoute } from '@angular/router';
5
+
6
+ /** A person in the organization, as the host knows them (identity's members). */
7
+ interface CodePerson {
8
+ id: string;
9
+ name: string;
10
+ email?: string;
11
+ }
12
+ /** The project the screens are on. */
13
+ interface CodeProject {
14
+ id: string;
15
+ key: string;
16
+ name: string;
17
+ /** The caller's capabilities on the project: code.write, protection.manage, resources.manage… */
18
+ capabilities: string[];
19
+ archivedAt?: string;
20
+ }
21
+ /**
22
+ * What the Code screens need from the app that mounts them (cloud/web provides it, as it provides
23
+ * DesignHost): where the person is, who is in the organization, and links inside the project.
24
+ */
25
+ declare abstract class CodeHost {
26
+ abstract readonly project: Signal<CodeProject | null>;
27
+ abstract readonly projectLoaded: Signal<boolean>;
28
+ abstract readonly people: Signal<CodePerson[]>;
29
+ abstract meId(): string;
30
+ /** A router link to a path inside the current project ('' is its overview). */
31
+ abstract link(path?: string): string[];
32
+ }
33
+
34
+ interface Repo {
35
+ projectId: string;
36
+ projectKey: string;
37
+ name: string;
38
+ slug: string;
39
+ description: string;
40
+ visibility: 'private' | 'internal';
41
+ defaultBranch: string;
42
+ mergeMethods: string[];
43
+ deleteBranchOnMerge: boolean;
44
+ archivedAt?: string;
45
+ createdBy: string;
46
+ pushedAt?: string;
47
+ sizeBytes: number;
48
+ importState?: string;
49
+ importSource?: string;
50
+ importError?: string;
51
+ cloneHttps: string;
52
+ cloneSsh: string;
53
+ empty: boolean;
54
+ capabilities: string[];
55
+ readOnly?: boolean;
56
+ createdAt?: string;
57
+ }
58
+ interface GitPerson {
59
+ name: string;
60
+ email: string;
61
+ when: string;
62
+ }
63
+ interface Commit {
64
+ oid: string;
65
+ short: string;
66
+ subject: string;
67
+ body?: string;
68
+ author: GitPerson;
69
+ committer: GitPerson;
70
+ parents: string[];
71
+ keys: string[];
72
+ }
73
+ interface FileChange {
74
+ status: string;
75
+ path: string;
76
+ oldPath?: string;
77
+ additions: number;
78
+ deletions: number;
79
+ binary: boolean;
80
+ }
81
+ interface CommitDetail extends Commit {
82
+ files: FileChange[];
83
+ additions: number;
84
+ deletions: number;
85
+ }
86
+ interface DiffLine {
87
+ kind: 'context' | 'add' | 'delete';
88
+ old?: number;
89
+ new?: number;
90
+ text: string;
91
+ html: string;
92
+ }
93
+ interface DiffHunk {
94
+ header: string;
95
+ oldStart: number;
96
+ oldLines: number;
97
+ newStart: number;
98
+ newLines: number;
99
+ lines: DiffLine[];
100
+ }
101
+ interface FileDiff {
102
+ path: string;
103
+ binary: boolean;
104
+ truncated: boolean;
105
+ hunks: DiffHunk[];
106
+ }
107
+ interface Comparison {
108
+ base: string;
109
+ head: string;
110
+ mergeBase: string;
111
+ ahead: number;
112
+ behind: number;
113
+ commits: Commit[];
114
+ files: FileChange[];
115
+ }
116
+ interface Entry {
117
+ name: string;
118
+ path: string;
119
+ type: 'tree' | 'blob' | 'commit';
120
+ size?: number;
121
+ lastCommit?: Commit;
122
+ }
123
+ interface Tree {
124
+ ref: string;
125
+ commit: string;
126
+ path: string;
127
+ entries: Entry[];
128
+ lastCommit?: Commit;
129
+ readme?: {
130
+ path: string;
131
+ html: string;
132
+ };
133
+ }
134
+ interface Blob {
135
+ ref: string;
136
+ commit: string;
137
+ path: string;
138
+ name: string;
139
+ oid: string;
140
+ size: number;
141
+ language?: string;
142
+ binary: boolean;
143
+ image: boolean;
144
+ truncated: boolean;
145
+ lineCount: number;
146
+ lines: string[];
147
+ markdown?: string;
148
+ rawUrl?: string;
149
+ downloadUrl?: string;
150
+ lastCommit?: Commit;
151
+ }
152
+ interface BlameHunk {
153
+ commit: string;
154
+ author: string;
155
+ when: string;
156
+ summary: string;
157
+ startLine: number;
158
+ lines: number;
159
+ }
160
+ interface Language {
161
+ name: string;
162
+ bytes: number;
163
+ percent: number;
164
+ }
165
+ interface Ref {
166
+ name: string;
167
+ kind: 'branch' | 'tag';
168
+ commit?: Commit;
169
+ default?: boolean;
170
+ protected?: boolean;
171
+ rule?: string;
172
+ ahead: number;
173
+ behind: number;
174
+ merged: boolean;
175
+ canDelete: boolean;
176
+ }
177
+ interface Protection {
178
+ id: string;
179
+ repoId: string;
180
+ pattern: string;
181
+ blockDirectPush: boolean;
182
+ blockForcePush: boolean;
183
+ blockDeletion: boolean;
184
+ requiredApprovals: number;
185
+ dismissStaleApprovals: boolean;
186
+ requireUpToDate: boolean;
187
+ requiredChecks: string[];
188
+ }
189
+ interface PullBrief {
190
+ number: number;
191
+ title: string;
192
+ state: 'open' | 'closed' | 'merged';
193
+ draft: boolean;
194
+ authorId: string;
195
+ source: string;
196
+ target: string;
197
+ labels: string[];
198
+ review: string;
199
+ checks: string;
200
+ comments: number;
201
+ keys: string[];
202
+ updatedAt?: string;
203
+ createdAt?: string;
204
+ }
205
+ interface GateRow {
206
+ text: string;
207
+ meta?: string;
208
+ status: string;
209
+ blocking: boolean;
210
+ users?: string[];
211
+ }
212
+ interface Gate {
213
+ mergeable: boolean;
214
+ title: string;
215
+ reasons: string[];
216
+ rows: GateRow[];
217
+ conflicts?: string[];
218
+ }
219
+ interface ReviewBrief {
220
+ authorId: string;
221
+ state: string;
222
+ commitSha: string;
223
+ stale: boolean;
224
+ at: string;
225
+ }
226
+ interface CheckStatus {
227
+ id: string;
228
+ sha: string;
229
+ context: string;
230
+ state: string;
231
+ url?: string;
232
+ description?: string;
233
+ }
234
+ interface Pull {
235
+ number: number;
236
+ title: string;
237
+ body: string;
238
+ authorId: string;
239
+ source: string;
240
+ target: string;
241
+ headSha: string;
242
+ state: 'open' | 'closed' | 'merged';
243
+ draft: boolean;
244
+ labels: string[];
245
+ reviewers: string[];
246
+ assignees: string[];
247
+ keys: string[];
248
+ mergeBase: string;
249
+ targetSha: string;
250
+ commits: number;
251
+ gate: Gate;
252
+ reviews: ReviewBrief[];
253
+ checks: CheckStatus[];
254
+ mergeMethods: string[];
255
+ deleteBranchOnMerge: boolean;
256
+ canMerge: boolean;
257
+ canReview: boolean;
258
+ canEdit: boolean;
259
+ sourceDeleted: boolean;
260
+ mergedSha?: string;
261
+ mergedBy?: string;
262
+ mergeMethod?: string;
263
+ mergedAt?: string;
264
+ closedAt?: string;
265
+ createdAt: string;
266
+ updatedAt?: string;
267
+ version: number;
268
+ }
269
+ interface PRComment {
270
+ id: string;
271
+ threadId?: string;
272
+ reviewId?: string;
273
+ authorId: string;
274
+ body: string;
275
+ pending: boolean;
276
+ createdAt: string;
277
+ editedAt?: string;
278
+ }
279
+ interface Review {
280
+ id: string;
281
+ authorId: string;
282
+ state: string;
283
+ body: string;
284
+ commitSha: string;
285
+ createdAt: string;
286
+ submittedAt?: string;
287
+ }
288
+ interface Thread {
289
+ id: string;
290
+ path: string;
291
+ side: 'old' | 'new';
292
+ line: number;
293
+ startLine: number;
294
+ commitSha: string;
295
+ outdated: boolean;
296
+ resolved: boolean;
297
+ resolvedBy?: string;
298
+ createdBy: string;
299
+ createdAt: string;
300
+ comments: PRComment[];
301
+ }
302
+ interface Timeline {
303
+ comments: PRComment[];
304
+ reviews: Review[];
305
+ threads: Thread[];
306
+ }
307
+ interface NewComment {
308
+ body: string;
309
+ path?: string;
310
+ side?: 'old' | 'new';
311
+ line?: number;
312
+ startLine?: number;
313
+ threadId?: string;
314
+ pending?: boolean;
315
+ }
316
+ declare function apiMessage(err: any, fallback?: string): string;
317
+ declare class CodeApi {
318
+ private readonly api;
319
+ private repoPath;
320
+ repos(project: string): Observable<Repo[]>;
321
+ create(project: string, body: {
322
+ name: string;
323
+ description?: string;
324
+ visibility?: string;
325
+ defaultBranch?: string;
326
+ readme?: boolean;
327
+ gitignore?: string;
328
+ licence?: string;
329
+ }): Observable<Repo>;
330
+ import(project: string, body: {
331
+ name: string;
332
+ url: string;
333
+ username?: string;
334
+ token?: string;
335
+ description?: string;
336
+ visibility?: string;
337
+ }): Observable<Repo>;
338
+ repo(project: string, name: string): Observable<Repo>;
339
+ update(project: string, name: string, body: Partial<{
340
+ name: string;
341
+ description: string;
342
+ visibility: string;
343
+ defaultBranch: string;
344
+ mergeMethods: string[];
345
+ deleteBranchOnMerge: boolean;
346
+ }>): Observable<Repo>;
347
+ remove(project: string, name: string): Observable<unknown>;
348
+ setArchived(project: string, name: string, on: boolean): Observable<Repo>;
349
+ protections(project: string, name: string): Observable<Protection[]>;
350
+ addProtection(project: string, name: string, p: Partial<Protection>): Observable<Protection>;
351
+ updateProtection(project: string, name: string, id: string, p: Partial<Protection>): Observable<Protection>;
352
+ removeProtection(project: string, name: string, id: string): Observable<unknown>;
353
+ tree(project: string, name: string, ref: string, path: string): Observable<Tree>;
354
+ blob(project: string, name: string, ref: string, path: string): Observable<Blob>;
355
+ blame(project: string, name: string, ref: string, path: string): Observable<BlameHunk[]>;
356
+ files(project: string, name: string, ref: string): Observable<{
357
+ files: string[];
358
+ truncated: boolean;
359
+ }>;
360
+ languages(project: string, name: string, ref: string): Observable<Language[]>;
361
+ archiveUrl(project: string, name: string, ref: string, format: 'zip' | 'tar.gz'): Observable<string>;
362
+ commits(project: string, name: string, q: {
363
+ ref?: string;
364
+ path?: string;
365
+ limit?: number;
366
+ skip?: number;
367
+ }): Observable<Commit[]>;
368
+ commit(project: string, name: string, sha: string): Observable<CommitDetail>;
369
+ /** One file's hunks from base to head ("" base: the head's first parent). */
370
+ diff(project: string, name: string, head: string, path: string, base?: string): Observable<FileDiff>;
371
+ compare(project: string, name: string, base: string, head: string): Observable<Comparison>;
372
+ refs(project: string, name: string, kind?: 'branch' | 'tag', q?: string): Observable<Ref[]>;
373
+ createBranch(project: string, name: string, branch: string, from: string): Observable<unknown>;
374
+ deleteBranch(project: string, name: string, branch: string): Observable<unknown>;
375
+ deleteMerged(project: string, name: string): Observable<{
376
+ deleted?: string[];
377
+ } | unknown>;
378
+ pulls(project: string, name: string, q?: {
379
+ state?: string;
380
+ author?: string;
381
+ reviewer?: string;
382
+ needsMyReview?: boolean;
383
+ label?: string;
384
+ q?: string;
385
+ }): Observable<PullBrief[]>;
386
+ template(project: string, name: string, target: string): Observable<string>;
387
+ openPull(project: string, name: string, body: {
388
+ source: string;
389
+ target: string;
390
+ title: string;
391
+ body?: string;
392
+ draft?: boolean;
393
+ reviewers?: string[];
394
+ labels?: string[];
395
+ }): Observable<Pull>;
396
+ pull(project: string, name: string, n: number): Observable<Pull>;
397
+ updatePull(project: string, name: string, n: number, body: Partial<{
398
+ title: string;
399
+ body: string;
400
+ draft: boolean;
401
+ target: string;
402
+ reviewers: string[];
403
+ assignees: string[];
404
+ labels: string[];
405
+ }>): Observable<Pull>;
406
+ closePull(project: string, name: string, n: number, reopen?: boolean): Observable<Pull>;
407
+ merge(project: string, name: string, n: number, body: {
408
+ method: string;
409
+ message?: string;
410
+ deleteBranch?: boolean;
411
+ expectHead?: string;
412
+ }): Observable<Pull>;
413
+ conversation(project: string, name: string, n: number): Observable<Timeline>;
414
+ comment(project: string, name: string, n: number, c: NewComment): Observable<PRComment>;
415
+ review(project: string, name: string, n: number, state: 'commented' | 'approved' | 'changes_requested', body?: string): Observable<Review>;
416
+ resolve(project: string, name: string, n: number, thread: string, on: boolean): Observable<unknown>;
417
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CodeApi, never>;
418
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<CodeApi>;
419
+ }
420
+
421
+ declare function shortDate(d?: string): string;
422
+ /** "Nov 7, 2026" for a day heading. */
423
+ declare function dayLabel(d?: string): string;
424
+ declare function ago(iso?: string, now?: number): string;
425
+ declare function initials(name: string): string;
426
+ declare function size(bytes?: number): string;
427
+ /** Names and initials by user id, from the host's people. */
428
+ declare class People {
429
+ private readonly byId;
430
+ constructor(people: CodePerson[]);
431
+ name(id?: string | null): string;
432
+ initials(id?: string | null): string;
433
+ }
434
+ declare function langColour(i: number): string;
435
+ /** The state of checks as a dot class: success green, failure red, pending amber, none grey. */
436
+ declare function checkDot(state: string): string;
437
+ declare function copy(text: string): Promise<void>;
438
+ /**
439
+ * The repository the person was last in, per project, so the project-level tabs (Files, Commits,
440
+ * Branches, Settings) open it. Browser storage is a convenience: without it the first repository is used.
441
+ */
442
+ declare class CurrentRepo {
443
+ get(project: string): string;
444
+ set(project: string, repo: string): void;
445
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CurrentRepo, never>;
446
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<CurrentRepo>;
447
+ }
448
+ /**
449
+ * Highlighted code from the server: spans with Chroma's short token classes behind "tk-" (tk-k a
450
+ * keyword, tk-s a string…), coloured with the theme's syntax tokens. Server HTML is not under the
451
+ * component's encapsulation, hence ::ng-deep.
452
+ */
453
+ declare const TOKEN_CSS = "\n :host ::ng-deep [class^=\"tk-k\"]{color:var(--o-tk-k)}\n :host ::ng-deep [class^=\"tk-s\"], :host ::ng-deep [class^=\"tk-l\"]{color:var(--o-tk-s)}\n :host ::ng-deep [class^=\"tk-c\"]{color:var(--o-tk-c);font-style:italic}\n :host ::ng-deep [class^=\"tk-m\"]{color:var(--o-tk-n)}\n :host ::ng-deep .tk-nf, :host ::ng-deep .tk-nx, :host ::ng-deep .tk-fm{color:var(--o-tk-f)}\n :host ::ng-deep .tk-nb, :host ::ng-deep .tk-nt, :host ::ng-deep .tk-bp{color:var(--o-tk-p)}\n :host ::ng-deep .tk-gi{color:var(--o-add)} :host ::ng-deep .tk-gd{color:var(--o-bad-tx)}\n";
454
+
455
+ /**
456
+ * What every page under /code/:repo shares: the project, the repository named in the URL (loaded
457
+ * once per name), the person's people and permissions, and an error line. Pages extend it and load
458
+ * their own data in onRepo().
459
+ */
460
+ declare abstract class RepoPage {
461
+ protected readonly host: CodeHost;
462
+ protected readonly api: CodeApi;
463
+ protected readonly route: ActivatedRoute;
464
+ private readonly current;
465
+ protected readonly name: _angular_core.WritableSignal<string>;
466
+ protected readonly repo: _angular_core.WritableSignal<Repo | null>;
467
+ protected readonly error: _angular_core.WritableSignal<string>;
468
+ protected readonly note: _angular_core.WritableSignal<string>;
469
+ protected readonly people: _angular_core.Signal<People>;
470
+ protected readonly canWrite: _angular_core.Signal<boolean>;
471
+ protected readonly canAdmin: _angular_core.Signal<boolean>;
472
+ protected readonly canProtect: _angular_core.Signal<boolean>;
473
+ constructor();
474
+ /** Called with the repository once it has loaded (and again after it changes). */
475
+ protected abstract onRepo(repo: Repo): void;
476
+ protected projectId(): string;
477
+ protected link(path?: string): string[];
478
+ protected reloadRepo(): void;
479
+ private loadRepo;
480
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RepoPage, never>;
481
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RepoPage, never, never, {}, {}, never, never, true, never>;
482
+ }
483
+ declare class RefPicker {
484
+ private readonly api;
485
+ private readonly host;
486
+ private readonly el;
487
+ readonly repo: _angular_core.InputSignal<string>;
488
+ readonly current: _angular_core.InputSignal<string>;
489
+ readonly picked: _angular_core.OutputEmitterRef<string>;
490
+ protected readonly open: _angular_core.WritableSignal<boolean>;
491
+ protected readonly q: _angular_core.WritableSignal<string>;
492
+ private readonly refs;
493
+ protected readonly kindOf: _angular_core.Signal<"branch" | "tag">;
494
+ protected shown(kind: 'branch' | 'tag'): Ref[];
495
+ protected toggle(): void;
496
+ protected pick(name: string): void;
497
+ protected outside(e: MouseEvent): void;
498
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RefPicker, never>;
499
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RefPicker, "o-ref-picker", never, { "repo": { "alias": "repo"; "required": true; "isSignal": true; }; "current": { "alias": "current"; "required": true; "isSignal": true; }; }, { "picked": "picked"; }, never, never, true, never>;
500
+ }
501
+
502
+ interface LineComment {
503
+ path: string;
504
+ side: 'old' | 'new';
505
+ line: number;
506
+ body: string;
507
+ }
508
+ interface ThreadReply {
509
+ threadId: string;
510
+ body: string;
511
+ }
512
+ declare class DiffView {
513
+ private readonly api;
514
+ private readonly host;
515
+ readonly repo: _angular_core.InputSignal<string>;
516
+ readonly file: _angular_core.InputSignal<FileChange>;
517
+ readonly head: _angular_core.InputSignal<string>;
518
+ readonly base: _angular_core.InputSignal<string>;
519
+ readonly threads: _angular_core.InputSignal<Thread[]>;
520
+ readonly canComment: _angular_core.InputSignal<boolean>;
521
+ readonly comment: _angular_core.OutputEmitterRef<LineComment>;
522
+ readonly reply: _angular_core.OutputEmitterRef<ThreadReply>;
523
+ readonly resolve: _angular_core.OutputEmitterRef<{
524
+ threadId: string;
525
+ resolved: boolean;
526
+ }>;
527
+ protected readonly open: _angular_core.WritableSignal<boolean>;
528
+ protected readonly diff: _angular_core.WritableSignal<FileDiff | null>;
529
+ protected readonly error: _angular_core.WritableSignal<string>;
530
+ protected readonly drafting: _angular_core.WritableSignal<string>;
531
+ protected readonly draftBody: _angular_core.WritableSignal<string>;
532
+ protected readonly replies: _angular_core.WritableSignal<Record<string, string>>;
533
+ protected readonly people: _angular_core.Signal<People>;
534
+ protected readonly threadsHere: _angular_core.Signal<Thread[]>;
535
+ protected readonly ago: (s?: string) => string;
536
+ constructor();
537
+ protected key(l: DiffLine): string;
538
+ protected lineOf(l: DiffLine): number;
539
+ protected threadsAt(l: DiffLine): Thread[];
540
+ protected startComment(l: DiffLine): void;
541
+ protected send(l: DiffLine): void;
542
+ protected setReply(id: string, v: string): void;
543
+ protected sendReply(id: string): void;
544
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DiffView, never>;
545
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DiffView, "o-diff", never, { "repo": { "alias": "repo"; "required": true; "isSignal": true; }; "file": { "alias": "file"; "required": true; "isSignal": true; }; "head": { "alias": "head"; "required": true; "isSignal": true; }; "base": { "alias": "base"; "required": false; "isSignal": true; }; "threads": { "alias": "threads"; "required": false; "isSignal": true; }; "canComment": { "alias": "canComment"; "required": false; "isSignal": true; }; }, { "comment": "comment"; "reply": "reply"; "resolve": "resolve"; }, never, ["*"], true, never>;
546
+ }
547
+
548
+ declare class ReposPage {
549
+ protected readonly host: CodeHost;
550
+ private readonly api;
551
+ protected readonly repos: _angular_core.WritableSignal<Repo[]>;
552
+ protected readonly loaded: _angular_core.WritableSignal<boolean>;
553
+ protected readonly error: _angular_core.WritableSignal<string>;
554
+ protected readonly ago: (s?: string) => string;
555
+ protected readonly canWrite: _angular_core.Signal<boolean>;
556
+ constructor();
557
+ protected sizeOf(b: number): string;
558
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ReposPage, never>;
559
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ReposPage, "o-code-repos", never, {}, {}, never, never, true, never>;
560
+ }
561
+ declare class NewRepoPage {
562
+ protected readonly host: CodeHost;
563
+ private readonly api;
564
+ private readonly route;
565
+ protected readonly mode: _angular_core.WritableSignal<"create" | "import">;
566
+ protected readonly made: _angular_core.WritableSignal<Repo | null>;
567
+ protected readonly proto: _angular_core.WritableSignal<"https" | "ssh">;
568
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
569
+ protected readonly error: _angular_core.WritableSignal<string>;
570
+ protected readonly copied: _angular_core.WritableSignal<boolean>;
571
+ protected readonly url: _angular_core.Signal<string>;
572
+ protected repoName: string;
573
+ protected desc: string;
574
+ protected vis: 'private' | 'internal';
575
+ protected branch: string;
576
+ protected readme: boolean;
577
+ protected gitignore: string;
578
+ protected licence: string;
579
+ protected url_: string;
580
+ protected user: string;
581
+ protected token: string;
582
+ constructor();
583
+ protected nameFromUrl(): void;
584
+ protected copyUrl(): void;
585
+ protected create(): void;
586
+ protected importRepo(): void;
587
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NewRepoPage, never>;
588
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NewRepoPage, "o-code-new", never, {}, {}, never, never, true, never>;
589
+ }
590
+ declare class CurrentRepoPage {
591
+ protected readonly host: CodeHost;
592
+ private readonly api;
593
+ private readonly route;
594
+ private readonly router;
595
+ private readonly current;
596
+ protected readonly none: _angular_core.WritableSignal<boolean>;
597
+ protected readonly error: _angular_core.WritableSignal<string>;
598
+ constructor();
599
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CurrentRepoPage, never>;
600
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CurrentRepoPage, "o-code-current", never, {}, {}, never, never, true, never>;
601
+ }
602
+
603
+ declare class RepoHomePage extends RepoPage {
604
+ private readonly router;
605
+ private readonly el;
606
+ protected readonly tree: _angular_core.WritableSignal<Tree | null>;
607
+ protected readonly langs: _angular_core.WritableSignal<Language[]>;
608
+ protected readonly ref: _angular_core.WritableSignal<string>;
609
+ protected readonly path: _angular_core.WritableSignal<string>;
610
+ protected readonly proto: _angular_core.WritableSignal<"https" | "ssh">;
611
+ protected readonly cloneOpen: _angular_core.WritableSignal<boolean>;
612
+ protected readonly copied: _angular_core.WritableSignal<boolean>;
613
+ protected readonly finding: _angular_core.WritableSignal<boolean>;
614
+ protected readonly fq: _angular_core.WritableSignal<string>;
615
+ protected readonly files: _angular_core.WritableSignal<string[]>;
616
+ protected readonly ago: (s?: string) => string;
617
+ protected readonly initials: typeof initials;
618
+ protected readonly colour: typeof langColour;
619
+ protected readonly cloneUrl: _angular_core.Signal<string>;
620
+ protected readonly crumbs: _angular_core.Signal<{
621
+ name: string;
622
+ path: string;
623
+ }[]>;
624
+ protected readonly parent: _angular_core.Signal<string>;
625
+ protected readonly found: _angular_core.Signal<string[]>;
626
+ protected readonly langLabel: _angular_core.Signal<string>;
627
+ constructor();
628
+ protected onRepo(r: Repo): void;
629
+ protected qp(path: string): {
630
+ ref: string | null;
631
+ path: string | null;
632
+ };
633
+ protected go(ref: string, path: string): void;
634
+ protected copyClone(): void;
635
+ protected archive(format: 'zip' | 'tar.gz'): void;
636
+ protected openFirst(): void;
637
+ /** T opens Go to file (prototype). */
638
+ protected key(e: KeyboardEvent): void;
639
+ private load;
640
+ protected openFinder(): void;
641
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RepoHomePage, never>;
642
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RepoHomePage, "o-code-repo", never, {}, {}, never, never, true, never>;
643
+ }
644
+
645
+ declare class FilePage extends RepoPage {
646
+ private readonly router;
647
+ protected readonly blob: _angular_core.WritableSignal<Blob | null>;
648
+ protected readonly blame: _angular_core.WritableSignal<BlameHunk[]>;
649
+ protected readonly blaming: _angular_core.WritableSignal<boolean>;
650
+ protected readonly ref: _angular_core.WritableSignal<string>;
651
+ protected readonly path: _angular_core.WritableSignal<string>;
652
+ protected readonly line: _angular_core.WritableSignal<number>;
653
+ protected readonly view: _angular_core.WritableSignal<"code" | "preview">;
654
+ protected readonly copied: _angular_core.WritableSignal<boolean>;
655
+ protected readonly ago: (s?: string) => string;
656
+ protected readonly initials: typeof initials;
657
+ protected readonly crumbs: _angular_core.Signal<{
658
+ name: string;
659
+ path: string;
660
+ }[]>;
661
+ protected readonly meta: _angular_core.Signal<string>;
662
+ constructor();
663
+ protected onRepo(r: Repo): void;
664
+ protected pickRef(ref: string): void;
665
+ protected pickLine(n: number): void;
666
+ protected copyText(): void;
667
+ protected toggleBlame(): void;
668
+ protected blameAt(n: number): BlameHunk | undefined;
669
+ /** The hunk's commit and author on its first line only. */
670
+ protected blameLabel(n: number): string;
671
+ private load;
672
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FilePage, never>;
673
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FilePage, "o-code-file", never, {}, {}, never, never, true, never>;
674
+ }
675
+
676
+ declare class CommitsPage extends RepoPage {
677
+ private readonly router;
678
+ protected readonly commits: _angular_core.WritableSignal<Commit[]>;
679
+ protected readonly ref: _angular_core.WritableSignal<string>;
680
+ protected readonly path: _angular_core.WritableSignal<string>;
681
+ protected readonly loading: _angular_core.WritableSignal<boolean>;
682
+ protected readonly more: _angular_core.WritableSignal<boolean>;
683
+ protected readonly ago: (s?: string) => string;
684
+ protected readonly initials: typeof initials;
685
+ protected readonly groups: _angular_core.Signal<{
686
+ day: string;
687
+ items: Commit[];
688
+ }[]>;
689
+ constructor();
690
+ protected onRepo(r: Repo): void;
691
+ protected pickRef(ref: string): void;
692
+ protected next(): void;
693
+ private load;
694
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CommitsPage, never>;
695
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommitsPage, "o-code-commits", never, {}, {}, never, never, true, never>;
696
+ }
697
+ declare class CommitPage extends RepoPage {
698
+ protected readonly commit: _angular_core.WritableSignal<CommitDetail | null>;
699
+ protected readonly ago: (s?: string) => string;
700
+ protected readonly initials: typeof initials;
701
+ private sha;
702
+ constructor();
703
+ protected onRepo(r: Repo): void;
704
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CommitPage, never>;
705
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommitPage, "o-code-commit", never, {}, {}, never, never, true, never>;
706
+ }
707
+ declare class BranchesPage extends RepoPage {
708
+ protected readonly refs: _angular_core.WritableSignal<Ref[]>;
709
+ protected readonly pulls: _angular_core.WritableSignal<{
710
+ number: number;
711
+ state: string;
712
+ source: string;
713
+ }[]>;
714
+ protected readonly adding: _angular_core.WritableSignal<boolean>;
715
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
716
+ protected readonly ago: (s?: string) => string;
717
+ protected readonly initials: typeof initials;
718
+ protected newName: string;
719
+ protected from: string;
720
+ private readonly maxAB;
721
+ protected onRepo(r: Repo): void;
722
+ protected bar(n: number): number;
723
+ protected pullFor(branch: string): {
724
+ number: number;
725
+ state: string;
726
+ source: string;
727
+ } | undefined;
728
+ protected create(): void;
729
+ protected remove(b: Ref): void;
730
+ protected deleteMerged(): void;
731
+ private load;
732
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BranchesPage, never>;
733
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BranchesPage, "o-code-branches", never, {}, {}, never, never, true, never>;
734
+ }
735
+
736
+ interface Row extends PullBrief {
737
+ repo: string;
738
+ }
739
+ declare class PullsPage {
740
+ protected readonly host: CodeHost;
741
+ private readonly api;
742
+ private readonly route;
743
+ private readonly router;
744
+ protected readonly states: {
745
+ id: string;
746
+ label: string;
747
+ icon: string;
748
+ }[];
749
+ protected readonly repoName: _angular_core.WritableSignal<string>;
750
+ protected readonly repos: _angular_core.WritableSignal<Repo[]>;
751
+ protected readonly rows: _angular_core.WritableSignal<Row[]>;
752
+ protected readonly state: _angular_core.WritableSignal<string>;
753
+ protected readonly mine: _angular_core.WritableSignal<boolean>;
754
+ protected readonly loading: _angular_core.WritableSignal<boolean>;
755
+ protected readonly error: _angular_core.WritableSignal<string>;
756
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
757
+ protected readonly opening: _angular_core.WritableSignal<boolean>;
758
+ protected readonly newRepo: _angular_core.WritableSignal<string>;
759
+ protected readonly branches: _angular_core.WritableSignal<Ref[]>;
760
+ protected readonly source: _angular_core.WritableSignal<string>;
761
+ protected readonly target: _angular_core.WritableSignal<string>;
762
+ protected readonly cmp: _angular_core.WritableSignal<Comparison | null>;
763
+ protected q: string;
764
+ protected author: string;
765
+ protected title: string;
766
+ protected body: string;
767
+ protected reviewer: string;
768
+ protected draft: boolean;
769
+ private wantNew;
770
+ protected readonly people: _angular_core.Signal<People>;
771
+ protected readonly ago: (s?: string) => string;
772
+ protected readonly dot: typeof checkDot;
773
+ protected readonly review: (r: string) => string;
774
+ protected readonly canWrite: _angular_core.Signal<boolean>;
775
+ constructor();
776
+ protected load(): void;
777
+ protected startNew(source: string): void;
778
+ protected pickRepo(name: string, source?: string): void;
779
+ protected compare(): void;
780
+ protected open(): void;
781
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PullsPage, never>;
782
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PullsPage, "o-code-pulls", never, {}, {}, never, never, true, never>;
783
+ }
784
+
785
+ type Tab = 'conversation' | 'commits' | 'files' | 'checks';
786
+ interface Event {
787
+ at: string;
788
+ kind: 'comment' | 'review' | 'thread';
789
+ who: string;
790
+ body?: string;
791
+ state?: string;
792
+ thread?: Thread;
793
+ id: string;
794
+ }
795
+ declare class PullPage extends RepoPage {
796
+ private readonly el;
797
+ protected readonly pr: _angular_core.WritableSignal<Pull | null>;
798
+ protected readonly timeline: _angular_core.WritableSignal<Timeline>;
799
+ protected readonly cmp: _angular_core.WritableSignal<Comparison | null>;
800
+ protected readonly tab: _angular_core.WritableSignal<Tab>;
801
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
802
+ protected readonly draft: _angular_core.WritableSignal<string>;
803
+ protected readonly reviewOpen: _angular_core.WritableSignal<boolean>;
804
+ protected readonly revBody: _angular_core.WritableSignal<string>;
805
+ protected readonly revKind: _angular_core.WritableSignal<"commented" | "approved" | "changes_requested">;
806
+ protected readonly mergeMenu: _angular_core.WritableSignal<boolean>;
807
+ protected readonly method: _angular_core.WritableSignal<string>;
808
+ protected readonly delBranch: _angular_core.WritableSignal<boolean>;
809
+ private number;
810
+ protected readonly ago: (s?: string) => string;
811
+ protected readonly initials: typeof initials;
812
+ protected readonly dot: typeof checkDot;
813
+ protected readonly threads: _angular_core.Signal<Thread[]>;
814
+ protected readonly openThreads: _angular_core.Signal<number>;
815
+ protected readonly tabs: _angular_core.Signal<{
816
+ id: Tab;
817
+ label: string;
818
+ n: number | undefined;
819
+ }[]>;
820
+ protected readonly badge: _angular_core.Signal<"" | "Open" | "Merged" | "Closed" | "Draft">;
821
+ protected readonly badgeBg: _angular_core.Signal<string>;
822
+ protected readonly approvedByMe: _angular_core.Signal<boolean>;
823
+ protected readonly reviewKinds: _angular_core.Signal<({
824
+ id: "commented";
825
+ label: string;
826
+ hint: string;
827
+ } | {
828
+ id: "approved";
829
+ label: string;
830
+ hint: string;
831
+ } | {
832
+ id: "changes_requested";
833
+ label: string;
834
+ hint: string;
835
+ })[]>;
836
+ protected readonly reviewers: _angular_core.Signal<{
837
+ id: string;
838
+ label: string;
839
+ colour: string;
840
+ }[]>;
841
+ protected readonly events: _angular_core.Signal<Event[]>;
842
+ constructor();
843
+ protected onRepo(_: Repo): void;
844
+ protected md(s: string): string;
845
+ protected pick(t: Tab): void;
846
+ protected methodLabel(m: string): string;
847
+ protected methodHint(m: string): string;
848
+ protected methodDone(m?: string): string;
849
+ protected reviewVerb(state?: string): "approved these changes" | "requested changes" | "had a review dismissed" | "reviewed";
850
+ protected rowDot(status: string): "o-dot o-grn" | "o-dot o-red" | "o-dot o-amb";
851
+ protected approve(): void;
852
+ protected submitReview(): void;
853
+ protected addComment(): void;
854
+ protected lineComment(c: LineComment): void;
855
+ protected reply(r: ThreadReply): void;
856
+ protected resolve(e: {
857
+ threadId: string;
858
+ resolved: boolean;
859
+ }): void;
860
+ protected merge(): void;
861
+ protected close(reopen: boolean): void;
862
+ protected outside(e: MouseEvent): void;
863
+ private sendReview;
864
+ private run;
865
+ private load;
866
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PullPage, never>;
867
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PullPage, "o-code-pull", never, {}, {}, never, never, true, never>;
868
+ }
869
+
870
+ type Section = 'general' | 'protect' | 'collab' | 'danger';
871
+ interface RuleForm {
872
+ id: string;
873
+ pattern: string;
874
+ blockDirectPush: boolean;
875
+ blockForcePush: boolean;
876
+ blockDeletion: boolean;
877
+ requiredApprovals: number;
878
+ dismissStaleApprovals: boolean;
879
+ requireUpToDate: boolean;
880
+ requiredChecks: string[];
881
+ }
882
+ declare class RepoSettingsPage extends RepoPage {
883
+ private readonly router;
884
+ protected readonly section: _angular_core.WritableSignal<Section>;
885
+ protected readonly branches: _angular_core.WritableSignal<Ref[]>;
886
+ protected readonly rules: _angular_core.WritableSignal<Protection[]>;
887
+ protected readonly form: _angular_core.WritableSignal<RuleForm | null>;
888
+ protected readonly check: _angular_core.WritableSignal<string>;
889
+ protected readonly confirm: _angular_core.WritableSignal<string>;
890
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
891
+ protected g: {
892
+ name: string;
893
+ description: string;
894
+ visibility: string;
895
+ defaultBranch: string;
896
+ mergeMethods: string[];
897
+ deleteBranchOnMerge: boolean;
898
+ };
899
+ protected readonly methods: {
900
+ id: string;
901
+ label: string;
902
+ }[];
903
+ protected readonly toggles: {
904
+ key: 'blockDirectPush' | 'blockForcePush' | 'blockDeletion' | 'dismissStaleApprovals' | 'requireUpToDate';
905
+ label: string;
906
+ hint: string;
907
+ }[];
908
+ constructor();
909
+ protected onRepo(r: Repo): void;
910
+ protected go(s: Section): void;
911
+ protected max0(n: number): number;
912
+ protected flipMethod(id: string): void;
913
+ protected summary(p: Protection): string;
914
+ protected edit(p: Protection | null): void;
915
+ protected flip(f: RuleForm, k: (typeof this.toggles)[number]['key']): void;
916
+ protected addCheck(f: RuleForm): void;
917
+ protected removeCheck(f: RuleForm, c: string): void;
918
+ protected saveGeneral(): void;
919
+ protected saveRule(): void;
920
+ protected removeRule(f: RuleForm): void;
921
+ protected archive(on: boolean): void;
922
+ protected remove(): void;
923
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RepoSettingsPage, never>;
924
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RepoSettingsPage, "o-code-settings", never, {}, {}, never, never, true, never>;
925
+ }
926
+
927
+ export { BranchesPage, CodeApi, CodeHost, CommitPage, CommitsPage, CurrentRepo, CurrentRepoPage, DiffView, FilePage, NewRepoPage, People, PullPage, PullsPage, RefPicker, RepoHomePage, RepoPage, RepoSettingsPage, ReposPage, TOKEN_CSS, ago, apiMessage, checkDot, copy, dayLabel, initials, langColour, shortDate, size };
928
+ export type { BlameHunk, Blob, CheckStatus, CodePerson, CodeProject, Commit, CommitDetail, Comparison, DiffHunk, DiffLine, Entry, FileChange, FileDiff, Gate, GateRow, GitPerson, Language, LineComment, NewComment, PRComment, Protection, Pull, PullBrief, Ref, Repo, Review, ReviewBrief, Thread, ThreadReply, Timeline, Tree };