New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ff-global

Package Overview
Dependencies
Maintainers
1
Versions
219
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ff-global

Fieldflint 全局属性

latest
npmnpm
Version
4.1.63
Version published
Weekly downloads
16
-90.8%
Maintainers
1
Weekly downloads
 
Created
Source

Field Flint 系统全局变量

安装

npm install ff-global -S

引入方法

主进程

import "ff-global/main"

渲染进程

import 'ff-global/renderer'

预注入进程

import 'ff-global/preload'

工具(如果只是用到一部分工具)

import util from 'ff-global/util'

注意:上面的使用方法必须在入口顶端引入,以保证全局使用

使用方法

当上面正确引入后,系统会一个全局变量,主进程为global.ff,渲染进程为window.ff,在使用过程中可以直接使用ff 如判断对象为空对象的方法:ff.util.isEmptyObject({})

主进程


type ValueOf<T> = T[keyof T]

declare global {
	namespace ff {
		type MezzFileType = ValueOf<typeof MezzFileType>
		type MqttStatus = ValueOf<typeof MqttStatus>
		type LiveActionType = ValueOf<typeof LiveActionType>
		//gc全局
		namespace gc {
			type KeyboardShortcut = Gc.KeyboardShortcut
			type Client = Gc.Client
			type Subscribes = Gc.Subscribes
		}
	}
	var ff: {
		MqttStatus: typeof MqttStatus
		LiveActionType: typeof LiveActionType
		env: typeof env
		error: typeof error
		util: Util
		gc: ff.gc.Client
		Ajax: typeof Ajax
		//用户信息 store
		userInfo: User.UserInfo | null
		//cm列表
		cmList: User.CMItem[]
		browsers: { [id: string]: BrowserView } //打开的浏览器集合

		currentBrowserTab?: WebContents //当 前显示的浏览器tab页
		//当前浏览的account
		current_account: null | f2.ServerAccount
		//显示中的窗口
		show_popup: {
			[key: string]: boolean
		}
		//当前的tab页,位置
		$tabId: number
	}

	namespace NodeJS {
		interface Global {
			mainWindow: BrowserWindow
		}
	}
}

渲染进程


declare global {
	namespace Axios {
		type Canceler = C
		type RequestConfig = AxiosRequestConfig
	}

	namespace ff {
		type MezzFileType = ValueOf<typeof MezzFileType>
		type MqttStatus = ValueOf<typeof MqttStatus>
		type LiveActionType = ValueOf<typeof LiveActionType>

		//mqtt全局
		namespace mqtt {
			interface Subs {
				[topic: string]: (...data: any) => void
			}
		}

		//gc全局
		namespace gc {
			type KeyboardShortcut = Gc.KeyboardShortcut
			type Client = Gc.Client
			type IpcTopic = Gc.IpcTopic
			type Subscribes = Gc.Subscribes
		}

		namespace country {
			type CountryBase = CB
			type Country = Co
		}
		namespace linkedin {
			type AccountStatus = LinkedinAccount
			type LiStatData = GetLiStatData
		}
	}
}

declare global {
	var ff: Readonly<{
		env: typeof env
		MezzFileType: typeof MezzFileType //常量,mezz文件类型
		MqttStatus: typeof MqttStatus
		LiveActionType: typeof LiveActionType
		Ajax: typeof Ajax
		util: Util
		error: typeof error
		gc: typeof gc
		mqtt: typeof mqtt
		axios: AxiosStatic
		nameSplit: NameSplit
		dateTime: typeof DateTime
		contactInfo: typeof ContactInfo
		linkedin: Linkedin
		country: CountryClass
		analyzeText: {
			company: AnalyzeText
			contact: AnalyzeText
		}
		crawler: {
			util: CrawlerUtil
			db: CrawlerDb
		}
	}>
}

FAQs

Package last updated on 30 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts