mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-01 03:59:42 +08:00
📦 Chore: update electron from v6 -> v16
This commit is contained in:
@@ -14,3 +14,16 @@ export const PICGO_GET_BY_ID_DB = 'PICGO_GET_BY_ID_DB'
|
||||
export const PICGO_REMOVE_BY_ID_DB = 'PICGO_REMOVE_BY_ID_DB'
|
||||
export const PICGO_OPEN_FILE = 'PICGO_OPEN_FILE'
|
||||
export const OPEN_DEVTOOLS = 'OPEN_DEVTOOLS'
|
||||
export const SHOW_MINI_PAGE_MENU = 'SHOW_MINI_PAGE_MENU'
|
||||
export const SHOW_MAIN_PAGE_MENU = 'SHOW_MAIN_PAGE_MENU'
|
||||
export const SHOW_UPLOAD_PAGE_MENU = 'SHOW_UPLOAD_PAGE_MENU'
|
||||
export const SHOW_PLUGIN_PAGE_MENU = 'SHOW_PLUGIN_PAGE_MENU'
|
||||
export const MINIMIZE_WINDOW = 'MINIMIZE_WINDOW'
|
||||
export const CLOSE_WINDOW = 'CLOSE_WINDOW'
|
||||
export const OPEN_USER_STORE_FILE = 'OPEN_USER_STORE_FILE'
|
||||
export const OPEN_URL = 'OPEN_URL'
|
||||
export const RELOAD_APP = 'RELOAD_APP'
|
||||
export const PICGO_CONFIG_PLUGIN = 'PICGO_CONFIG_PLUGIN'
|
||||
export const PICGO_HANDLE_PLUGIN_ING = 'PICGO_HANDLE_PLUGIN_ING'
|
||||
export const PICGO_TOGGLE_PLUGIN = 'PICGO_TOGGLE_PLUGIN'
|
||||
export const PASTE_TEXT = 'PASTE_TEXT'
|
||||
|
||||
10
src/universal/types/electron.d.ts
vendored
10
src/universal/types/electron.d.ts
vendored
@@ -23,11 +23,7 @@ declare interface IWindowManager {
|
||||
|
||||
// https://stackoverflow.com/questions/35074713/extending-typescript-global-object-in-node-js/44387594#44387594
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface Global {
|
||||
PICGO_GUI_VERSION: string
|
||||
PICGO_CORE_VERSION: string
|
||||
notificationList?: IAppNotification[]
|
||||
}
|
||||
}
|
||||
var PICGO_GUI_VERSION: string
|
||||
var PICGO_CORE_VERSION: string
|
||||
var notificationList: IAppNotification[]
|
||||
}
|
||||
|
||||
3
src/universal/types/types.d.ts
vendored
3
src/universal/types/types.d.ts
vendored
@@ -15,7 +15,7 @@ declare interface ErrnoException extends Error {
|
||||
stack?: string;
|
||||
}
|
||||
|
||||
declare var __static: string
|
||||
declare let __static: string
|
||||
|
||||
declare type ILogType = 'success' | 'info' | 'warn' | 'error'
|
||||
|
||||
@@ -94,6 +94,7 @@ interface IBrowserWindowOptions {
|
||||
webPreferences: {
|
||||
nodeIntegration: boolean,
|
||||
nodeIntegrationInWorker: boolean,
|
||||
contextIsolation: boolean,
|
||||
backgroundThrottling: boolean
|
||||
webSecurity?: boolean
|
||||
},
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { IPasteStyle } from '#/types/enum'
|
||||
|
||||
const formatCustomLink = (customLink: string, item: ImgInfo) => {
|
||||
let fileName = item.fileName!.replace(new RegExp(`\\${item.extname}$`), '')
|
||||
const url = item.url || item.imgUrl
|
||||
const formatObj = {
|
||||
url,
|
||||
fileName
|
||||
}
|
||||
const keys = Object.keys(formatObj) as ['url', 'fileName']
|
||||
keys.forEach(item => {
|
||||
if (customLink.indexOf(`$${item}`) !== -1) {
|
||||
let reg = new RegExp(`\\$${item}`, 'g')
|
||||
customLink = customLink.replace(reg, formatObj[item])
|
||||
}
|
||||
})
|
||||
return customLink
|
||||
}
|
||||
|
||||
export default (style: IPasteStyle, item: ImgInfo, customLink: string | undefined) => {
|
||||
const url = item.url || item.imgUrl
|
||||
const _customLink = customLink || '$url'
|
||||
const tpl = {
|
||||
'markdown': ``,
|
||||
'HTML': `<img src="${url}"/>`,
|
||||
'URL': url,
|
||||
'UBB': `[IMG]${url}[/IMG]`,
|
||||
'Custom': formatCustomLink(_customLink, item)
|
||||
}
|
||||
return tpl[style]
|
||||
}
|
||||
Reference in New Issue
Block a user