Skip to content

Commit 7817f73

Browse files
add intro pages to docs
1 parent c934bf3 commit 7817f73

13 files changed

Lines changed: 222 additions & 39 deletions

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"style-loader": "^3.3.1",
5959
"ts-loader": "^9.3.1",
6060
"typedoc": "^0.28.16",
61-
"typescript": "^5.0.4",
61+
"typescript": "^5.9.3",
6262
"webpack": "^5.95.0",
6363
"webpack-cli": "^4.10.0"
6464
}

src/api_docs/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# OllieOS API Documentation
22

3+
*Please note this documentation is a work in progress and may be incomplete or subject to change.*
4+
35
Welcome to the OllieOS Program API documentation.
46

57
This document provides an overview of the APIs available to your program and their usage.
@@ -8,17 +10,17 @@ The APIs and context are exposed to the program by passing a [data object](./int
810

911
## Categories
1012

11-
### [Userspace API](./modules/Userspace.html)
13+
### [Userspace API](./documents/Userspace_API.html)
1214

1315
All programs have access to the Userspace API, providing limited access to the kernel but allowing interaction with the system.
1416

15-
### [Kernel (Privileged) API](./modules/Kernel_(Privileged).html)
17+
### [Kernel (Privileged) API](./documents/Kernel_(Privileged).html)
1618

17-
Programs that start privileged, or successfully [request elevation](./interfaces/Userspace.UserspaceKernel.html#request_privilege-1), have access to the Kernel API, which provides full access to the system.
19+
Programs that start privileged, or successfully [request elevation](./interfaces/UserspaceKernel.html#request_privilege), have access to the Kernel API, which provides full access to the system.
1820

1921
This is a responsibility, and programs should only request elevation when absolutely necessary.
2022

21-
### [Program Types](./modules/Program_Types.html)
23+
### [Program Types](./documents/Program_Types.html)
2224

2325
Additional information on the type assertions applied to define a program in OllieOS.
2426

src/api_docs/index.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
export * as userspace from "./userspace";
1+
/**
2+
* @packageDocumentation
3+
* @module API Documentation
4+
*
5+
* @document userspace_intro.md
6+
* @document privileged_intro.md
7+
* @document types_intro.md
8+
*/
29

3-
export * as privileged from "./privileged";
10+
export * from "./userspace";
411

5-
export * as types from "./types";
12+
export * from "./privileged";
13+
14+
export * from "./types";

src/api_docs/privileged.ts

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
/**
2-
* @module Kernel (Privileged)
3-
* @description API documentation for the additional privileged full kernel access API (granted to programs with privileged access).
4-
*/
5-
6-
export type { Kernel } from "../kernel";
7-
export type { AbstractFileSystem } from "../kernel/filesystem";
8-
export type { ProcessManager, ProcessContext, IPCManager } from "../kernel/processes";
9-
export type { ProgramRegistry } from "../kernel/prog_registry";
10-
export type { AbstractWindow, AbstractWindowManager } from "../kernel/windowing";
2+
* @group Kernel (Privileged)
3+
* @groupDescription API documentation for the additional privileged full kernel access API (granted to programs with privileged access).
4+
*
5+
* @category Kernel
6+
*/
7+
export { Kernel } from "../kernel";
8+
9+
/**
10+
* @group Kernel (Privileged)
11+
* @category Filesystem
12+
*/
13+
export { AbstractFileSystem } from "../kernel/filesystem";
14+
15+
/**
16+
* @group Kernel (Privileged)
17+
* @category Processes
18+
*/
19+
export { ProcessManager, ProcessContext, IPCManager } from "../kernel/processes";
20+
21+
/**
22+
* @group Kernel (Privileged)
23+
* @category Programs
24+
*/
25+
export { ProgramRegistry } from "../kernel/prog_registry";
26+
27+
/**
28+
* @group Kernel (Privileged)
29+
* @category Windowing
30+
*/
31+
export { AbstractWindow, AbstractWindowManager } from "../kernel/windowing";
32+
33+
// TODO: figure out why groups/categories dont always descend properly (manually defined groups on kernel etc) or just define it everywhere on each interface

src/api_docs/privileged_intro.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Kernel (Privileged) API
3+
group: Kernel (Privileged)
4+
category: Introduction
5+
---
6+
7+
# Kernel (Privileged) API
8+
9+
Programs that start privileged, or successfully [request elevation](./interfaces/UserspaceKernel.html#request_privilege), have access to the Kernel API, which provides full access to the system.
10+
11+
This is a responsibility, and programs should only request elevation when absolutely necessary.

src/api_docs/types.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
/**
2-
* @module Program Types
3-
* @description Type interfaces for the definition of program files.
2+
* @group Program Types
3+
* @groupDescription Type interfaces for the definition of program files.
4+
*
5+
* @category Programs
46
*/
5-
6-
export type {
7+
export {
78
Program,
89
ProgramMain,
910
ProgramMainData,
1011
ArgDescriptions,
12+
} from "../types";
13+
14+
/**
15+
* @group Program Types
16+
* @category Completions
17+
*/
18+
export {
1119
CompletionGenerator,
1220
CompletionData,
21+
} from "../types";
22+
23+
/**
24+
* @group Program Types
25+
* @category Privileged-by-default Programs
26+
*/
27+
export {
1328
PrivilegedProgram,
1429
PrivilegedProgramMain,
1530
PrivilegedProgramMainData

src/api_docs/types_intro.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Program Types
3+
group: Program Types
4+
category: Introduction
5+
---
6+
7+
# Program Types
8+
9+
Additional information on the type assertions applied to define a program in OllieOS.

src/api_docs/userspace.ts

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
11
/**
2-
* @module Userspace
3-
* @description API documentation for the userspace program API.
4-
*/
2+
* @group Userspace
3+
* @groupDescription API documentation for the userspace program API.
4+
*
5+
* @category Kernel
6+
*/
7+
export {UserspaceKernel, SpawnResult, ParsedCommandLine} from "../kernel";
58

6-
export type {UserspaceKernel, SpawnResult, ParsedCommandLine} from "../kernel";
7-
export type {UserspaceFileSystem, FSEventType, FSEventHandler} from "../kernel/filesystem";
8-
export type {
9+
/**
10+
* @group Userspace
11+
* @category Terminal
12+
*/
13+
export {WrappedTerminal, KeyEvent, KeyEventHandler, RegisteredKeyEventIdentifier, ReadLineBuffer, ReadLineKeyHandler} from "../kernel/term_ctl";
14+
15+
/**
16+
* @group Userspace
17+
* @category Filesystem
18+
*/
19+
export {
20+
UserspaceFileSystem,
21+
FSEventType,
22+
FSEventHandler,
23+
PathNotFoundError,
24+
MoveDestinationDirectoryNotEmptyError,
25+
NonRecursiveDirectoryError,
26+
ReadOnlyError
27+
} from "../kernel/filesystem";
28+
29+
/**
30+
* @group Userspace
31+
* @category Processes
32+
*/
33+
export {
934
UserspaceProcessManager,
1035
UserspaceProcessContext,
1136
UserspaceOtherProcessContext,
@@ -15,10 +40,27 @@ export type {
1540
IPCChannelListener,
1641
IPCServiceOnConnectionCallback,
1742
} from "../kernel/processes";
18-
export type {UserspaceWindowManager, UserspaceWindow, UserspaceOtherWindow, WindowEvent} from "../kernel/windowing";
19-
export type {UserspaceProgramRegistry, ProgramRegistrant} from "../kernel/prog_registry";
20-
export type {SoundRegistry} from "../kernel/sfx_registry";
2143

22-
export type {WrappedTerminal, KeyEvent, KeyEventHandler, RegisteredKeyEventIdentifier, ReadLineBuffer, ReadLineKeyHandler} from "../kernel/term_ctl";
44+
/**
45+
* @group Userspace
46+
* @category Programs
47+
*/
48+
export {UserspaceProgramRegistry, ProgramRegistrant} from "../kernel/prog_registry";
2349

24-
export type {AbstractShell, AbstractShellMemory} from "../abstract_shell";
50+
/**
51+
* @group Userspace
52+
* @category Windowing
53+
*/
54+
export {UserspaceWindowManager, UserspaceWindow, UserspaceOtherWindow, WindowEvent} from "../kernel/windowing";
55+
56+
/**
57+
* @group Userspace
58+
* @category Sound
59+
*/
60+
export {SoundRegistry} from "../kernel/sfx_registry";
61+
62+
/**
63+
* @group Userspace
64+
* @category Shells
65+
*/
66+
export {AbstractShell, AbstractShellMemory} from "../abstract_shell";

src/api_docs/userspace_intro.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Userspace API
3+
group: Userspace
4+
category: Introduction
5+
---
6+
7+
# Userspace API
8+
9+
All programs have access to the Userspace API, providing limited access to the kernel but allowing interaction with the system.

0 commit comments

Comments
 (0)