Merge pull request #31166 from schultzp2020/constructor-parameters
refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
This commit is contained in:
@@ -27,11 +27,13 @@ import { FormDecoratorBlueprint } from '@backstage/plugin-scaffolder-react/alpha
|
||||
export class DefaultScaffolderFormDecoratorsApi
|
||||
implements ScaffolderFormDecoratorsApi
|
||||
{
|
||||
private constructor(
|
||||
private readonly options: {
|
||||
decorators: Array<ScaffolderFormDecorator>;
|
||||
},
|
||||
) {}
|
||||
private readonly options: {
|
||||
decorators: Array<ScaffolderFormDecorator>;
|
||||
};
|
||||
|
||||
private constructor(options: { decorators: Array<ScaffolderFormDecorator> }) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
static create(options?: { decorators: ScaffolderFormDecorator[] }) {
|
||||
return new DefaultScaffolderFormDecoratorsApi(
|
||||
|
||||
@@ -32,7 +32,7 @@ import { renderHook } from '@testing-library/react';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { formDecoratorsApiRef } from '../../api';
|
||||
|
||||
window.TextEncoder = TextEncoder;
|
||||
window.TextEncoder = TextEncoder as any;
|
||||
|
||||
describe('base64EncodeContent', () => {
|
||||
it('encodes text files', () => {
|
||||
|
||||
@@ -17,7 +17,13 @@
|
||||
import { TemplateDirectoryAccess, TemplateFileAccess } from './types';
|
||||
|
||||
class MockFileAccess implements TemplateFileAccess {
|
||||
constructor(readonly path: string, private content: string) {}
|
||||
readonly path: string;
|
||||
private content: string;
|
||||
|
||||
constructor(path: string, content: string) {
|
||||
this.path = path;
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
async file(): Promise<File> {
|
||||
const blob = new Blob([this.content]);
|
||||
|
||||
@@ -36,10 +36,13 @@ const showDirectoryPicker = (window as any).showDirectoryPicker as
|
||||
| undefined;
|
||||
|
||||
class WebFileAccess implements TemplateFileAccess {
|
||||
constructor(
|
||||
readonly path: string,
|
||||
private readonly handle: WritableFileHandle,
|
||||
) {}
|
||||
readonly path: string;
|
||||
private readonly handle: WritableFileHandle;
|
||||
|
||||
constructor(path: string, handle: WritableFileHandle) {
|
||||
this.path = path;
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
file(): Promise<File> {
|
||||
return this.handle.getFile();
|
||||
@@ -54,7 +57,11 @@ class WebFileAccess implements TemplateFileAccess {
|
||||
|
||||
/** @internal */
|
||||
export class WebDirectoryAccess implements TemplateDirectoryAccess {
|
||||
constructor(private readonly handle: IterableDirectoryHandle) {}
|
||||
private readonly handle: IterableDirectoryHandle;
|
||||
|
||||
constructor(handle: IterableDirectoryHandle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
async listFiles(): Promise<TemplateFileAccess[]> {
|
||||
const content = [];
|
||||
|
||||
Reference in New Issue
Block a user