summaryrefslogtreecommitdiff
path: root/core/gjs/src/file.ts
diff options
context:
space:
mode:
authorKevin <[email protected]>2024-10-16 00:49:16 -0300
committerKevin <[email protected]>2024-10-16 00:49:16 -0300
commit2b1e8501b46056b79d97e90c6ec94e3ad36d0ab2 (patch)
tree6486e98bd1ba523b1aeb4bd2566d1ff6e5c41798 /core/gjs/src/file.ts
parent03f2c4706faba7dac5aee71b10255eac218cbeec (diff)
parent236487001ab2a6c9c8e87e5db0ced9e5ab3ed791 (diff)
Merge branch 'adapt-upstream-changes'
Diffstat (limited to 'core/gjs/src/file.ts')
-rw-r--r--core/gjs/src/file.ts44
1 files changed, 0 insertions, 44 deletions
diff --git a/core/gjs/src/file.ts b/core/gjs/src/file.ts
deleted file mode 100644
index 90b33a1..0000000
--- a/core/gjs/src/file.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { Astal, Gio } from "./imports.js"
-
-export function readFile(path: string): string {
- return Astal.read_file(path) || ""
-}
-
-export function readFileAsync(path: string): Promise<string> {
- return new Promise((resolve, reject) => {
- Astal.read_file_async(path, (_, res) => {
- try {
- resolve(Astal.read_file_finish(res) || "")
- }
- catch (error) {
- reject(error)
- }
- })
- })
-}
-
-export function writeFile(path: string, content: string): void {
- Astal.write_file(path, content)
-}
-
-export function writeFileAsync(path: string, content: string): Promise<void> {
- return new Promise((resolve, reject) => {
- Astal.write_file_async(path, content, (_, res) => {
- try {
- resolve(Astal.write_file_finish(res))
- }
- catch (error) {
- reject(error)
- }
- })
- })
-}
-
-export function monitorFile(
- path: string,
- callback: (file: string, event: Gio.FileMonitorEvent) => void,
-): Gio.FileMonitor {
- return Astal.monitor_file(path, (file: string, event: Gio.FileMonitorEvent) => {
- callback(file, event)
- })!
-}