Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/trusted-types

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/trusted-types

TypeScript definitions for trusted-types

  • 2.0.7
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.6M
decreased by-5.19%
Maintainers
1
Weekly downloads
 
Created

What is @types/trusted-types?

The @types/trusted-types npm package provides TypeScript type definitions for the Trusted Types API, which is a web security standard aimed at preventing Cross-Site Scripting (XSS) by restricting access to potentially dangerous DOM APIs. These type definitions allow developers to use Trusted Types in TypeScript projects with type checking and IntelliSense support.

What are @types/trusted-types's main functionalities?

Type Definitions for Trusted Types

This feature provides TypeScript type definitions for creating and manipulating Trusted Types, such as TrustedHTML, TrustedScript, and TrustedURL. The code sample demonstrates how to create a TrustedHTML type using a Trusted Types policy.

import { TrustedHTML, TrustedScriptURL } from 'trusted-types';

function createTrustedTypes(policyName: string): TrustedHTML {
  const policy = trustedTypes.createPolicy(policyName, {
    createHTML: (input) => input
  });
  return policy.createHTML('<div>Safe Content</div>');
}

Other packages similar to @types/trusted-types

FAQs

Package last updated on 21 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc