Skip to content

Commit

Permalink
Roll back unbrotil changes. Limiting to files and ignoring import TS …
Browse files Browse the repository at this point in the history
…errors
  • Loading branch information
ramonjd committed Nov 29, 2024
1 parent 0fc5fec commit e18b597
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
44 changes: 13 additions & 31 deletions packages/edit-site/lib/unbrotli.js
Original file line number Diff line number Diff line change
Expand Up @@ -1703,19 +1703,11 @@ function fromByteArray (uint8) {
decoding of the block lengths, literal insertion lengths and copy lengths.
*/

/**
* Represents the range of values belonging to a prefix code.
* [offset, offset + 2^nbits)
*
* @param {number} offset The starting offset of the range.
* @param {number} nbits The number of bits defining the range.
* @constructor
*/
class PrefixCodeRange {
constructor( offset, nbits ) {
this.offset = offset;
this.nbits = nbits;
}
/* Represents the range of values belonging to a prefix code: */
/* [offset, offset + 2^nbits) */
function PrefixCodeRange(offset, nbits) {
this.offset = offset;
this.nbits = nbits;
}

exports.kBlockLengthPrefixCode = [
Expand Down Expand Up @@ -1832,26 +1824,16 @@ var kOmitFirst7 = 18;
var kOmitFirst8 = 19;
var kOmitFirst9 = 20;

/**
* Represents a transformation with a prefix, a transform type, and a suffix.
*
* @param {string} prefix - The prefix string.
* @param {number} transform - The transform type.
* @param {string} suffix - The suffix string.
* @constructor
*/
class Transform {
constructor( prefix, transform, suffix ) {
this.prefix = new Uint8Array( prefix.length );
this.transform = transform;
this.suffix = new Uint8Array(suffix.length);
function Transform(prefix, transform, suffix) {
this.prefix = new Uint8Array(prefix.length);
this.transform = transform;
this.suffix = new Uint8Array(suffix.length);

for ( var i = 0; i < prefix.length; i++ )
this.prefix[i] = prefix.charCodeAt( i );
for (var i = 0; i < prefix.length; i++)
this.prefix[i] = prefix.charCodeAt(i);

for ( var i = 0; i < suffix.length; i++ )
this.suffix[i] = suffix.charCodeAt( i );
}
for (var i = 0; i < suffix.length; i++)
this.suffix[i] = suffix.charCodeAt(i);
}

var kTransforms = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import clsx from 'clsx';
import { __experimentalGrid as Grid } from '@wordpress/components';
import { View } from '@wordpress/primitives';
import {
// @ts-ignore
getColorClassName,
// @ts-ignore
__experimentalGetGradientClass,
// @ts-ignore
} from '@wordpress/block-editor';
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-site/src/components/style-book/examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import {
// @ts-ignore
getBlockType,
// @ts-ignore
getBlockTypes,
// @ts-ignore
getBlockFromExample,
// @ts-ignore
createBlock,
// @ts-ignore
} from '@wordpress/blocks';
Expand Down
15 changes: 12 additions & 3 deletions packages/edit-site/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"declarationDir": "build-types",
"checkJs": false
"declarationDir": "build-types"
},
"references": [
{ "path": "../a11y" },
Expand Down Expand Up @@ -42,5 +41,15 @@
{ "path": "../url" },
{ "path": "../wordcount" }
],
"include": [ "src/**/*" ]
// NOTE: This package is being progressively typed. You are encouraged to
// expand this array with files which can be type-checked. At some point in
// the future, this can be simplified to an `includes` of `src/**/*`.
"files": [
"src/components/style-book/categories.ts",
"src/components/style-book/constants.ts",
"src/components/style-book/types.ts",
"src/components/style-book/color-examples.tsx",
"src/components/style-book/duotone-examples.tsx",
"src/components/style-book/examples.tsx"
]
}

0 comments on commit e18b597

Please sign in to comment.