Home / File/ custom-plugin.js — astro Source File

custom-plugin.js — astro Source File

Architecture documentation for custom-plugin.js, a javascript file in the astro codebase. 1 imports, 0 dependents.

File javascript DevToolbar ToolbarClient 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  8fcf7572_4c00_7f4b_d029_7ff33d3137d3["custom-plugin.js"]
  813b050c_f3a5_c569_7dc8_62a7ea18fb38["toolbar"]
  8fcf7572_4c00_7f4b_d029_7ff33d3137d3 --> 813b050c_f3a5_c569_7dc8_62a7ea18fb38
  style 8fcf7572_4c00_7f4b_d029_7ff33d3137d3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { defineToolbarApp } from "astro/toolbar";

export default defineToolbarApp({
	init(canvas, app, server) {
		const astroWindow = document.createElement('astro-dev-toolbar-window');
		const myButton = document.createElement('astro-dev-toolbar-button');
		myButton.size = 'medium';
		myButton.buttonStyle = 'purple';
		myButton.innerText = 'Click me!';

		myButton.addEventListener('click', () => {
			console.log('Clicked!');
		});

		app.toggleNotification({
			state: true,
			level: 'warning'
		})

		server.on("super-server-event", (data) => {
			astroWindow.appendChild(document.createTextNode(data.message));
		});

		astroWindow.appendChild(myButton);

		canvas.appendChild(astroWindow);
	},
});

Domain

Subdomains

Functions

Dependencies

  • toolbar

Frequently Asked Questions

What does custom-plugin.js do?
custom-plugin.js is a source file in the astro codebase, written in javascript. It belongs to the DevToolbar domain, ToolbarClient subdomain.
What functions are defined in custom-plugin.js?
custom-plugin.js defines 1 function(s): default.init.
What does custom-plugin.js depend on?
custom-plugin.js imports 1 module(s): toolbar.
Where is custom-plugin.js in the architecture?
custom-plugin.js is located at packages/astro/e2e/fixtures/dev-toolbar/custom-plugin.js (domain: DevToolbar, subdomain: ToolbarClient, directory: packages/astro/e2e/fixtures/dev-toolbar).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free