Skip to content

KObject

Defined in: src/kobject.ts:15

Unlike Linux, we don’t use ksets, ktypes, or attribute groups.

new KObject(name, parent?): KObject

Defined in: src/kobject.ts:25

string

KObject | null

KObject

attributes: Map<string, Attribute>

Defined in: src/kobject.ts:23

These attributes use the kobject’s show and store.


children: Map<string, KEntry>

Defined in: src/kobject.ts:18


readonly mode: number = 0o555

Defined in: src/kobject.ts:16


name: string

Defined in: src/kobject.ts:26


optional parent?: KObject | null

Defined in: src/kobject.ts:27

get path(): string

Defined in: src/kobject.ts:36

The path of this kobject, relative to the root of sysfs.

string

[dispose](): void

Defined in: src/kobject.ts:74

void


add_uevent_attr(): void

Defined in: src/kobject.ts:117

void


create_attribute(name, show?, store?, mode?): Attribute

Defined in: src/kobject.ts:134

string

((kobj) => string) | null

((kobj, value) => void) | null

number = ...

Defaults based on which of show and store were passed.

Attribute


dispose(): void

Defined in: src/kobject.ts:66

void


keys(): Iterable<string>

Defined in: src/kobject.ts:62

The names of everything in this kobject.

Iterable<string>


lookup(name): KEntry | undefined

Defined in: src/kobject.ts:46

Resolve a single entry by name. Attributes that use this kobject’s show and store are bound before being returned.

string

KEntry | undefined


notify_uevent(action, env?): void

Defined in: src/kobject.ts:84

Notify listeners that something happened to kobj.

"add" | "remove" | "change" | "move" | "online" | "offline" | "bind" | "unbind"

UEventEnv = {}

void


send_uevent(text): void

Defined in: src/kobject.ts:102

Send a uevent described by text, an action optionally followed by KEY=VALUE pairs. This is what writing to a uevent attribute does.

string

void


optional show(attr): string

Defined in: src/kobject.ts:78

Attribute

string


optional store(attr, value): void

Defined in: src/kobject.ts:79

Attribute

string

void


optional uevent(env): void

Defined in: src/kobject.ts:129

Add variables to the environment of uevents sent for this kobject and its descendants.

UEventEnv

void

notify_uevent