Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sketch up a simple terminal API. #1

Open
wants to merge 2 commits into
base: resources
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,659 changes: 780 additions & 879 deletions command.md

Large diffs are not rendered by default.

30 changes: 12 additions & 18 deletions wit/deps/clocks/timezone.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,19 @@ interface timezone {
/// In timezones that recognize daylight saving time, also known as daylight
/// time and summer time, the information returned from the functions varies
/// over time to reflect these adjustments.
///
/// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources).
type timezone = u32

/// Return information needed to display the given `datetime`. This includes
/// the UTC offset, the time zone name, and a flag indicating whether
/// daylight saving time is active.
///
/// If the timezone cannot be determined for the given `datetime`, return a
/// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
/// saving time.
display: func(this: timezone, when: datetime) -> timezone-display

/// The same as `display`, but only return the UTC offset.
utc-offset: func(this: timezone, when: datetime) -> s32
resource timezone {
/// Return information needed to display the given `datetime`. This includes
/// the UTC offset, the time zone name, and a flag indicating whether
/// daylight saving time is active.
///
/// If the timezone cannot be determined for the given `datetime`, return a
/// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
/// saving time.
display: func(when: datetime) -> timezone-display

/// Dispose of the specified input-stream, after which it may no longer
/// be used.
drop-timezone: func(this: timezone)
/// The same as `display`, but only return the UTC offset.
utc-offset: func(when: datetime) -> s32
}

/// Information useful for displaying the timezone of a specific `datetime`.
///
Expand Down
6 changes: 6 additions & 0 deletions wit/deps/filesystem/preopens.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface preopens {
use types.{descriptor}

/// Return the set of preopened directories, and their path.
get-directories: func() -> list<tuple<descriptor, string>>
}
Loading