Vanessa 2024-03-24 22:35:30 +08:00
parent e922c402c8
commit 1f607cf08a
9 changed files with 15 additions and 294 deletions

View file

@ -1,16 +1,16 @@
/**
* Copyright (C) 2023 SiYuan Community
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@ -65,6 +65,7 @@ declare namespace Config {
openHelp: boolean;
/**
* Whether it is running in read-only mode
*
*/
readonly: boolean;
repo: IRepo;
@ -133,6 +134,7 @@ declare namespace Config {
apiModel: TOpenAIModel;
/**
* API Provider
* OpenAI, Azure
*/
apiProvider: APIProvider;
/**
@ -1191,8 +1193,8 @@ declare namespace Config {
/**
* Cloud storage service provider
* - `0`: SiYuan official cloud storage service
* - `1`: Object storage service compatible with S3 protocol
* - `2`: Network storage service using WebDAV protocol
* - `2`: Object storage service compatible with S3 protocol
* - `3`: Network storage service using WebDAV protocol
*/
provider: number;
s3: ISyncS3;

View file

@ -607,61 +607,6 @@ interface ITab {
callback?: (tab: import("../layout/Tab").Tab) => void
}
interface IExport {
fileAnnotationRefMode: number
blockRefMode: number
blockEmbedMode: number
blockRefTextLeft: string
blockRefTextRight: string
tagOpenMarker: string
tagCloseMarker: string
pandocBin: string
paragraphBeginningSpace: boolean;
addTitle: boolean;
markdownYFM: boolean;
pdfFooter: string;
pdfWatermarkStr: string;
pdfWatermarkDesc: string;
imageWatermarkStr: string;
imageWatermarkDesc: string;
docxTemplate: string;
}
interface IEditor {
justify: boolean;
fontSizeScrollZoom: boolean;
rtl: boolean;
readOnly: boolean;
listLogicalOutdent: boolean;
listItemDotNumberClickFocus: boolean;
spellcheck: boolean;
onlySearchForDoc: boolean;
katexMacros: string;
fullWidth: boolean;
floatWindowMode: number;
dynamicLoadBlocks: number;
fontSize: number;
generateHistoryInterval: number;
historyRetentionDays: number;
codeLineWrap: boolean;
displayBookmarkIcon: boolean;
displayNetImgMark: boolean;
codeSyntaxHighlightLineNum: boolean;
embedBlockBreadcrumb: boolean;
plantUMLServePath: string;
codeLigatures: boolean;
codeTabSpaces: number;
fontFamily: string;
virtualBlockRef: boolean;
virtualBlockRefExclude: string;
virtualBlockRefInclude: string;
blockRefDynamicAnchorTextMaxLen: number;
backlinkExpandCount: number;
backmentionExpandCount: number;
emoji: string[];
}
interface IWebSocketData {
cmd?: string
callback?: string
@ -671,194 +616,6 @@ interface IWebSocketData {
sid?: string
}
interface IAppearance {
modeOS: boolean,
hideStatusBar: boolean,
themeJS: boolean,
mode: number, // 1 暗黑0 明亮
icon: string,
closeButtonBehavior: number // 0退出1最小化到托盘
codeBlockThemeDark: string
codeBlockThemeLight: string
themeDark: string
themeLight: string
icons: string[]
lang: string
iconVer: string
themeVer: string
lightThemes: string[]
darkThemes: string[]
}
interface IFileTree {
closeTabsOnStart: boolean
alwaysSelectOpenedFile: boolean
openFilesUseCurrentTab: boolean
removeDocWithoutConfirm: boolean
useSingleLineSave: boolean
allowCreateDeeper: boolean
refCreateSavePath: string
docCreateSavePath: string
sort: number
maxOpenTabCount: number
maxListCount: number
}
interface IAccount {
displayTitle: boolean
displayVIP: boolean
}
interface IConfig {
snippet: {
enabledCSS: boolean
enabledJS: boolean
}
cloudRegion: number
bazaar: {
trust: boolean
petalDisabled: boolean
}
repo: {
key: string
},
flashcard: {
newCardLimit: number
reviewCardLimit: number
mark: boolean
list: boolean
superBlock: boolean
heading: boolean
deck: boolean
reviewMode: number
requestRetention: number
maximumInterval: number
weights: string
}
ai: {
openAI: {
apiProvider: string // OpenAI, Azure
apiUserAgent: string
apiBaseURL: string
apiVersion: string
apiKey: string
apiModel: string
apiMaxTokens: number
apiTemperature: number
apiMaxContexts: number
apiProxy: string
apiTimeout: number
},
}
sync: {
generateConflictDoc: boolean
enabled: boolean
perception: boolean
mode: number
synced: number
stat: string
interval: number
cloudName: string
provider: number // 0 官方同步, 2 S3 3 WebDAV
s3: {
endpoint: string
pathStyle: boolean
accessKey: string
secretKey: string
bucket: string
region: string
skipTlsVerify: boolean
timeout: number
}
webdav: {
endpoint: string
username: string
password: string
skipTlsVerify: boolean
timeout: number
}
},
lang: string
api: {
token: string
}
openHelp: boolean
system: {
lockScreenMode: number // 0手动1手动+跟随系统
networkProxy: {
host: string
port: string
scheme: string
}
name: string
kernelVersion: string
isInsider: boolean
appDir: string
workspaceDir: string
confDir: string
dataDir: string
container: "std" | "android" | "docker" | "ios"
isMicrosoftStore: boolean
os: "windows" | "linux" | "darwin"
osPlatform: string
homeDir: string
xanadu: boolean
udanax: boolean
uploadErrLog: boolean
disableGoogleAnalytics: boolean
downloadInstallPkg: boolean
networkServe: boolean
fixedPort: boolean
autoLaunch: boolean
}
localIPs: string[]
readonly: boolean // 全局只读
uiLayout: Record<string, any>
langs: {
label: string,
name: string
}[]
appearance: IAppearance
editor: IEditor,
fileTree: IFileTree
graph: IGraph
keymap: IKeymap
export: IExport
accessAuthCode: string
account: IAccount
tag: {
sort: number
}
search: ISearchType & {
name: boolean
alias: boolean
memo: boolean
indexAssetPath: boolean
ial: boolean
limit: number
caseSensitive: boolean
backlinkMentionName: boolean
backlinkMentionAlias: boolean
backlinkMentionAnchor: boolean
backlinkMentionDoc: boolean
backlinkMentionKeywordsLimit: boolean
virtualRefName: boolean
virtualRefAlias: boolean
virtualRefAnchor: boolean
virtualRefDoc: boolean
},
stat: {
treeCount: number
cTreeCount: number
blockCount: number
cBlockCount: number
dataSize: number
cDataSize: number
assetsSize: number
cAssetsSize: number
}
}
interface IGraphCommon {
d3: {
centerStrength: number
@ -884,44 +641,6 @@ interface IGraphCommon {
}
}
interface IGraph {
global: {
minRefs: number
dailyNote: boolean
} & IGraphCommon
local: {
dailyNote: boolean
} & IGraphCommon
}
interface IKeymap {
plugin: {
[key: string]: {
[key: string]: IKeymapItem
}
}
general: {
[key: string]: IKeymapItem
}
editor: {
general: {
[key: string]: IKeymapItem
}
insert: {
[key: string]: IKeymapItem
}
heading: {
[key: string]: IKeymapItem
}
list: {
[key: string]: IKeymapItem
}
table: {
[key: string]: IKeymapItem
}
}
}
interface IKeymapItem {
default: string,
custom: string