Socket
Socket
Sign inDemoInstall

@types/trusted-types

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/trusted-types

TypeScript definitions for trusted-types


Version published
Weekly downloads
5.6M
decreased by-0.32%
Maintainers
1
Install size
8.38 kB
Created
Weekly downloads
 

Package description

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

Readme

Source

Installation

npm install --save @types/trusted-types

Summary

This package contains type definitions for trusted-types (https://github.com/WICG/trusted-types).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/trusted-types.

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Jakub Vrana, Damien Engels, Emanuel Tesar, Bjarki, and Sebastian Silbermann.

FAQs

Last updated on 21 Nov 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc