capacitor-synology-documents
v6.0.4
Published
Capacitor Synology Documents
Downloads
4
Readme
capacitor-synology-documents
Capacitor Synology Documents
Install
npm install capacitor-synology-documents
npx cap sync
Usage
import {SynologyDocs} from "capacitor-synology-documents";
SynologyDocs.configure('synology ip');
SynologyDocs.auth('username', 'password', 'otp (optional)');
API
echo(...)
configure(...)
auth(...)
readdir(...)
rename(...)
delete(...)
fileExist(...)
mkdir(...)
stat(...)
readFile(...)
writeFile(...)
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------- |
| options
| { value: string; } |
Returns: Promise<{ value: string; }>
configure(...)
configure(url: string) => void
| Param | Type |
| --------- | ------------------- |
| url
| string |
auth(...)
auth(username: string, password: string, otp_code?: string | undefined) => Promise<boolean>
| Param | Type |
| -------------- | ------------------- |
| username
| string |
| password
| string |
| otp_code
| string |
Returns: Promise<boolean>
readdir(...)
readdir(path: string) => Promise<{ isdir: boolean; name: string; path: string; }[]>
| Param | Type |
| ---------- | ------------------- |
| path
| string |
Returns: Promise<{ isdir: boolean; name: string; path: string; }[]>
rename(...)
rename(path: string, newName: string) => Promise<{ isdir: boolean; name: string; path: string; }>
| Param | Type |
| ------------- | ------------------- |
| path
| string |
| newName
| string |
Returns: Promise<{ isdir: boolean; name: string; path: string; }>
delete(...)
delete(path: string) => Promise<boolean>
| Param | Type |
| ---------- | ------------------- |
| path
| string |
Returns: Promise<boolean>
fileExist(...)
fileExist(path: string) => Promise<boolean>
| Param | Type |
| ---------- | ------------------- |
| path
| string |
Returns: Promise<boolean>
mkdir(...)
mkdir(path: string, name: string, force_parent?: boolean | undefined) => Promise<{ isdir: boolean; name: string; path: string; }>
| Param | Type |
| ------------------ | -------------------- |
| path
| string |
| name
| string |
| force_parent
| boolean |
Returns: Promise<{ isdir: boolean; name: string; path: string; }>
stat(...)
stat(path: string) => Promise<{ isdir: boolean; name: string; path: string; additional: { size: number; type: string; time: unknown; real_path: string; perm: unknown; owner: { user: string; }; }; }>
| Param | Type |
| ---------- | ------------------- |
| path
| string |
Returns: Promise<{ isdir: boolean; name: string; path: string; additional: { size: number; type: string; time: unknown; real_path: string; perm: unknown; owner: { user: string; }; }; }>
readFile(...)
readFile(path: string) => Promise<unknown>
| Param | Type |
| ---------- | ------------------- |
| path
| string |
Returns: Promise<unknown>
writeFile(...)
writeFile(path: string, fileName: string, content: string, type?: string | undefined) => Promise<unknown>
| Param | Type |
| -------------- | ------------------- |
| path
| string |
| fileName
| string |
| content
| string |
| type
| string |
Returns: Promise<unknown>