new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · API · all subjects

app/structure

108 notes in this subject, read out of this brain and free to use. This is page 1 of 2.

LanguageModelMessage role values

The role field of LanguageModelMessage must be one of: 'system', 'user', or 'assistant'.

LanguageModelMessage structure fields

LanguageModelMessage object has the following fields: role (string, required, can be 'system', 'user', or 'assistant'), content (LanguageModelMessageContent array, required), prefix (boolean, optional).

MediaAccessPermissionRequest object structure

MediaAccessPermissionRequest object extends PermissionRequest. It has two optional properties: securityOrigin (string) - the security origin of the request, and mediaTypes (string[]) - the types of media access being requested where elements can be 'video' or 'audio'.

MemoryInfo object structure

The MemoryInfo object contains memory usage statistics with the following properties: workingSetSize (Integer, required), peakWorkingSetSize (Integer, required), and privateBytes (Integer, optional, Windows only). All statistics are reported in Kilobytes.

MimeTypedBuffer structure fields

MimeTypedBuffer is an object with three fields: mimeType (string, optional) for the MIME type of the buffer, charset (string, optional) for the character encoding of the buffer, and data (Buffer, required) for the actual Buffer content.

MouseInputEvent object structure and properties

MouseInputEvent extends InputEvent and contains the following properties: type (string, required, can be mouseDown, mouseUp, mouseEnter, mouseLeave, contextMenu, mouseWheel, or mouseMove), x (Integer, required), y (Integer, required), button (string, optional, can be left, middle, or right), globalX (Integer, optional), globalY (Integer, optional), movementX (Integer, optional), movementY (Integer, optional), and clickCount (Integer, optional).

MouseWheelInputEvent structure and properties

MouseWheelInputEvent extends MouseInputEvent and has the following properties: type (string, can be 'mouseWheel'), deltaX (optional integer), deltaY (optional integer), wheelTicksX (optional integer), wheelTicksY (optional integer), accelerationRatioX (optional integer), accelerationRatioY (optional integer), hasPreciseScrollingDeltas (optional boolean), canScroll (optional boolean).

NavigationEntry structure fields

NavigationEntry is an object with the following fields: url (string, required), title (string, required), and pageState (string, optional). The pageState field contains a base64 encoded data string with Chromium page state including information like the current scroll position or form values. It is committed by Chromium before a navigation event and on a regular interval.

NotificationResponse object structure

The NotificationResponse object contains the following fields: actionIdentifier (string, required) - the identifier string of the action that the user selected; date (number, required) - the delivery date of the notification; identifier (string, required) - the unique identifier for this notification request; userInfo (Record<string, any>, required) - a dictionary of custom information associated with the notification; userText (string, optional) - the text entered or chosen by the user.

OpenExternalPermissionRequest object structure

OpenExternalPermissionRequest extends PermissionRequest and contains an optional externalURL field of type string that holds the url of the openExternal request.

PaymentDiscount Object structure

The PaymentDiscount object has the following properties: identifier (string, uniquely identifies a discount offer for a product), keyIdentifier (string, identifies the key used to generate the signature), nonce (string, a universally unique ID UUID value defined by the user), signature (string, a UTF-8 string representing the properties of a specific discount offer and cryptographically signed), and timestamp (number, the date and time of the signature's creation in milliseconds formatted in Unix epoch time).

OffscreenSharedTexture textureInfo.pixelFormat values

The pixelFormat property is a string that can have three possible values: 'rgba' (8-bit unorm RGBA texture format), 'bgra' (8-bit unorm BGRA texture format), or 'rgbaf16' (16-bit float RGBA texture format).

OffscreenSharedTexture object structure

The OffscreenSharedTexture object contains two properties: textureInfo (Object) and release (Function). The textureInfo property contains the shared texture information including widgetType, pixelFormat, codedSize, colorSpace, visibleRect, contentRect, timestamp, metadata, and handle. The release property is a function that releases the resources associated with the texture.

OffscreenSharedTexture textureInfo.widgetType

The widgetType property is a string that specifies the widget type of the texture. It can be either 'popup' or 'frame'.

OffscreenSharedTexture textureInfo.codedSize

The codedSize property is a Size object representing the full dimensions of the video frame.

OffscreenSharedTexture textureInfo.colorSpace

The colorSpace property is a ColorSpace object representing the color space of the video frame.

OffscreenSharedTexture textureInfo.visibleRect

The visibleRect property is a Rectangle object representing a subsection of the video frame defined by [0, 0, codedSize.width, codedSize.height]. In OSR (Off-Screen Rendering) cases, it is expected to have the full section area.

OffscreenSharedTexture textureInfo.contentRect

The contentRect property is a Rectangle object representing the region of the video frame that the capturer would like to populate. In OSR cases, it is the same as the dirtyRect that needs to be painted.

OffscreenSharedTexture textureInfo.timestamp

The timestamp property is a number representing the time in microseconds since the capture start.

OffscreenSharedTexture textureInfo.metadata properties

The metadata property is an Object that can contain the following optional properties: captureUpdateRect (Rectangle, optional) for the updated area of the frame also known as the dirty area; regionCaptureRect (Rectangle, optional) which may reflect the frame's contents origin if region capture is used internally; sourceSize (Rectangle, optional) for the full size of the source frame; and frameCount (number, optional) representing the increasing count of captured frames, which may contain gaps if frames are dropped between consecutively received frames.

OffscreenSharedTexture textureInfo.handle

The handle property is a SharedTextureHandle object containing the shared texture handle data.

OffscreenSharedTexture release function usage

The release function must be called to release the resources associated with the texture. The texture object cannot be directly passed to another process; users need to maintain texture lifecycles in the main process. However, it is safe to pass the textureInfo to another process. Only a limited number of textures can exist at the same time, so it is important to call texture.release() as soon as you are done with the texture.

PermissionRequest object structure

The PermissionRequest object has two properties: requestingUrl (string) - the last URL the requesting frame loaded, and isMainFrame (boolean) - whether the frame making the request is the main frame.

Point object x and y must be whole integers

Both x and y properties of a Point object must be whole integers. When providing a Point object as input to an Electron API, x and y values will be automatically rounded to the nearest whole integer.

Point object structure

A Point object contains two properties: x (number) and y (number).

PostBody object structure and fields

The PostBody object contains the following fields: data (array of UploadRawData or UploadFile, required) - the post data to be sent to the new window; contentType (string, required) - the content-type header used for the data, which must be either 'application/x-www-form-urlencoded' or 'multipart/form-data' and corresponds to the enctype attribute of the submitted HTML form; boundary (string, optional) - the boundary used to separate multiple parts of the message, only valid when contentType is 'multipart/form-data'.

PreloadScript Object structure

The PreloadScript Object contains three properties: type (string, context type where the preload script executes, possible values are 'frame' or 'service-worker'), id (string, unique ID of preload script), and filePath (string, path of the script file, must be an absolute path).

PreloadScriptRegistration object structure

PreloadScriptRegistration is an object with three properties: type (required string, values: 'frame' or 'service-worker'), id (optional string, defaults to random UUID), and filePath (required string, must be absolute path).

PreloadScriptRegistration object type property

The type property is a required string that specifies the context type where the preload script will be executed. Possible values are 'frame' or 'service-worker'.

PreloadScriptRegistration object filePath property

The filePath property is a required string that specifies the path of the script file. The path must be an absolute path.

PreloadScriptRegistration object id property

The id property is an optional string that provides a unique identifier for the preload script. It defaults to a random UUID if not specified.

PrintToPDFMargins top property

The top property is an optional number that specifies the top margin in inches. It defaults to 1cm (~0.4 inches).

PrintToPDFMargins right property

The right property is an optional number that specifies the right margin in inches. It defaults to 1cm (~0.4 inches).

PrintToPDFMargins object structure

The PrintToPDFMargins object has four optional number properties for specifying PDF margins in inches: top, bottom, left, and right. All properties default to 1cm, which is approximately 0.4 inches.

PrintToPDFMargins bottom property

The bottom property is an optional number that specifies the bottom margin in inches. It defaults to 1cm (~0.4 inches).

PrintToPDFOptions structure

PrintToPDFOptions is an object for configuring PDF printing. Fields: - landscape: boolean (optional). Paper orientation: true for landscape, false for portrait. Defaults to false. - displayHeaderFooter: boolean (optional). Whether to display header and footer. Defaults to false. - printBackground: boolean (optional). Whether to print background graphics. Defaults to false. - scale: number (optional). Scale of the webpage rendering. Defaults to 1. - pageSize: string | Size (optional). Specify page size of the generated PDF. Can be A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, or Ledger, or an Object containing height and width in inches. Defaults to Letter. - margins: PrintToPDFMargins (optional). Margins configuration. - pageRanges: string (optional). Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to empty string which means print all pages. - headerTemplate: string (optional). HTML template for the print header. Should be valid HTML markup with classes: date (formatted print date), title (document title), url (document location), pageNumber (current page number), totalPages (total pages). Example: <span class=title></span> generates span containing the title. - footerTemplate: string (optional). HTML template for the print footer. Should use the same format as headerTemplate. - preferCSSPageSize: boolean (optional). Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. - generateTaggedPDF: boolean (optional), experimental. Whether or not to generate a tagged (accessible) PDF. Defaults to false. The generated PDF may not adhere fully to PDF/UA and WCAG standards. - generateDocumentOutline: boolean (optional), experimental. Whether or not to generate a PDF document outline from content headers. Defaults to false.

ProcessMemoryInfo object structure

The ProcessMemoryInfo object contains three properties: residentSet (Integer, Linux and Windows only) representing memory pinned to physical RAM in Kilobytes; private (Integer) representing memory not shared by other processes such as JS heap or HTML content in Kilobytes; and shared (Integer) representing memory shared between processes typically consumed by Electron code itself in Kilobytes.

ProductDiscount object structure

ProductDiscount is an object with the following properties: identifier (string, used to uniquely identify a discount offer for a product), type (number, the type of discount offer), price (number, the discount price of the product in the local currency), priceLocale (string, the locale used to format the discount price of the product), paymentMode (string, the payment mode for this product discount which can be 'payAsYouGo', 'payUpFront', or 'freeTrial'), numberOfPeriods (number, an integer that indicates the number of periods the product discount is available), and subscriptionPeriod (optional ProductSubscriptionPeriod object that defines the period for the product discount).

ProductSubscriptionPeriod object structure

The ProductSubscriptionPeriod object contains two properties: numberOfUnits (number) which specifies the number of units per subscription period, and unit (string) which specifies the increment of time that a subscription period is measured in. The unit property can have one of four values: day, week, month, or year.

ProtocolRequest object structure

The ProtocolRequest object has the following fields: url (string, required), referrer (string, required), method (string, required), uploadData (UploadData[] array, optional), and headers (Record<string, string>, required).

Product Object structure

The Product object has the following fields: productIdentifier (string, required) - The string that identifies the product to the Apple App Store; localizedDescription (string, required) - A description of the product; localizedTitle (string, required) - The name of the product; price (number, required) - The cost of the product in the local currency; formattedPrice (string, required) - The locale formatted price of the product; currencyCode (string, required) - 3 character code presenting a product's currency based on the ISO 4217 standard; introductoryPrice (ProductDiscount, optional) - The object containing introductory price information for the product; discounts (ProductDiscount[], required) - An array of discount offers available for the product; subscriptionGroupIdentifier (string, required) - The identifier of the subscription group to which the subscription belongs; subscriptionPeriod (ProductSubscriptionPeriod, optional) - The period details for products that are subscriptions; isDownloadable (boolean, required) - A boolean value that indicates whether the App Store has downloadable content for this product (true if at least one file has been associated with the product); downloadContentVersion (string, required) - A string that identifies the version of the content; downloadContentLengths (number[], required) - The total size of the content, in bytes.

ProtocolResponse object structure

The ProtocolResponse object is used to define custom protocol responses. It has the following fields: error (Integer, optional) - When assigned, the request will fail with the error number from the net error list. statusCode (number, optional, default 200) - The HTTP response code. charset (string, optional, default "utf-8") - The charset of response body. mimeType (string, optional, default "text/html") - The MIME type of response body; setting mimeType implicitly sets the content-type header in response, but if content-type is already set in headers, the mimeType is ignored. headers (Record<string, string | string[]>, optional) - An object containing response headers where keys are strings and values are either string or array of string. data (Buffer | string | ReadableStream, optional) - The response body: a Node.js readable stream when returning stream, a Buffer when returning Buffer, or a string when returning string; ignored for other response types. path (string, optional) - Path to the file to be sent as response body, only used for file responses. url (string, optional) - URL to download and pipe as response body, only used for URL responses. referrer (string, optional) - The referrer URL, only used for file and URL responses. method (string, optional) - The HTTP method, only used for file and URL responses. session (Session, optional) - The session used for requesting URL; the HTTP request will reuse the current session by default. uploadData (ProtocolResponseUploadData, optional) - The data used as upload data, only used for URL responses when method is "POST".

Rectangle Object structure

The Rectangle Object is a structure with four required number properties: x (the x coordinate of the origin, must be an integer), y (the y coordinate of the origin, must be an integer), width (the width of the rectangle, must be an integer), and height (the height of the rectangle, must be an integer).

Referrer Object policy values

The policy field of the Referrer Object accepts these values: default, unsafe-url, no-referrer-when-downgrade, no-referrer, origin, strict-origin-when-cross-origin, same-origin, or strict-origin. These values follow the Referrer-Policy HTTP header specification.

Referrer Object structure

The Referrer Object has two fields: url (string, required) which is the HTTP Referrer URL, and policy (string, required) which specifies the referrer policy.

RenderProcessGoneDetails structure

The RenderProcessGoneDetails object has two properties: reason (string) and exitCode (Integer). The reason field indicates why the render process is gone, with possible values: 'clean-exit' (process exited with exit code zero), 'abnormal-exit' (process exited with non-zero exit code), 'killed' (process was sent SIGTERM or killed externally), 'crashed' (process crashed), 'oom' (process ran out of memory), 'launch-failed' (process never successfully launched), 'integrity-failure' (Windows code integrity checks failed), or 'memory-eviction' (process proactively terminated to prevent OOM). The exitCode is the exit code of the process, or a platform-specific launch failure error code if reason is 'launch-failed'.

ResolvedEndpoint object structure

ResolvedEndpoint object has two properties: address (string) and family (string). The family property can be one of three values: 'ipv4' which corresponds to AF_INET, 'ipv6' which corresponds to AF_INET6, or 'unspec' which corresponds to AF_UNSPEC.

ResolvedHost object structure

The ResolvedHost object is a structure that contains an endpoints property. The endpoints property is an array of ResolvedEndpoint objects representing resolved DNS entries for the hostname.

ScrubberItem structure fields

A ScrubberItem object has the following fields: label (string, optional) - The text to appear in this item; icon (NativeImage, optional) - The image to appear in this item.

SegmentedControlSegment structure fields

The SegmentedControlSegment object contains the following fields: label (string, optional) - the text to appear in this segment; icon (NativeImage, optional) - the image to appear in this segment; enabled (boolean, optional, default true) - whether this segment is selectable.

ServiceWorkerInfo object structure and fields

The ServiceWorkerInfo object contains the following fields: scriptUrl (string) - The full URL to the script that this service worker runs; scope (string) - The base URL that this service worker is active for; renderProcessId (number) - The virtual ID of the process that this service worker is running in, which is not an OS level PID and aligns with the ID set used for webContents.getProcessId(); versionId (number) - ID of the service worker version.

SharedDictionaryInfo object structure

The SharedDictionaryInfo object contains the following properties: match (string, the matching path pattern declared in 'use-as-dictionary' response header's match option), matchDestinations (string array, matching destinations declared in 'use-as-dictionary' response header's match-dest option), id (string, the dictionary Id from 'use-as-dictionary' response header's id option), dictionaryUrl (string, URL of the dictionary), lastFetchTime (Date, when the dictionary was received from the network layer), responseTime (Date, when the dictionary was received from the server, which may be far in the past for cached responses), expirationDuration (number, expiration time in seconds from 'use-as-dictionary' response header's expires option), lastUsedTime (Date, when the dictionary was last used), size (number, amount of bytes stored in Chromium's internal storage), and hash (string, the sha256 hash of the dictionary binary).

SharedDictionaryUsageInfo structure

SharedDictionaryUsageInfo is an object with three properties: frameOrigin (string), topFrameSite (string), and totalSizeBytes (number). It represents usage information for shared dictionaries in Chromium.

SharedTextureHandle structure

The SharedTextureHandle object is a cross-platform structure for holding shared textures with platform-specific fields. It contains ntHandle (Windows), ioSurface (macOS), and nativePixmap (Linux).

SharedTextureHandle.nativePixmap.planes (Linux)

planes is an array of Objects, each representing a plane's info in the shared texture. Each plane object contains stride (number), offset (number), size (number), and fd (number) fields. The stride and offset in bytes are used when accessing the buffers via memory mapping, with one per plane. The size is in bytes and is necessary to map the buffers. The fd is a file descriptor for the underlying memory object, usually dmabuf.

SharedTextureHandle.ntHandle (Windows)

ntHandle is an optional Buffer field on Windows that holds the shared texture as an NT HANDLE. The NT HANDLE is local to the current process only. Output textures of rgba, bgra, and rgbaf16 formats do not have a keyed mutex on the texture handle, but nv12 format texture handles do have a keyed mutex.

SharedTextureHandle.ioSurface (macOS)

ioSurface is an optional Buffer field on macOS that holds the shared texture as an IOSurfaceRef. The IOSurface is local to the current process only, not global.

SharedTextureHandle.nativePixmap.supportsZeroCopyWebGpuImport (Linux)

supportsZeroCopyWebGpuImport is a boolean field on Linux that indicates whether the shared texture supports zero copy import to WebGPU.

SharedTextureHandle.nativePixmap.modifier (Linux)

modifier is a string field on Linux that is retrieved from the GBM library and passed to the EGL driver.

SharedTextureHandle.nativePixmap (Linux)

nativePixmap is an optional Object field on Linux that contains the structure of planes for the shared texture. It includes a planes array, a modifier string from the GBM library, and a supportsZeroCopyWebGpuImport boolean.

Give your agent this brain