title: How is class-validator works?
body: <p>i have app with NestJs with server and client separately, in server side I use <code>ValidationPipe</code> and use decorators on DTO classes, for example</p>
  
  <pre><code>export class SearchDto {
     @IsOptional()
     readonly offset?: string;
  
     @IsString()
     readonly value: string;
  
     @IsNumber()
     readonly limit: number;
  }
  </code></pre>
  
  <p>And all works OK, but on the client-side I can't use classes with decorators (its strict rule) and I simply need to use it like <code>type</code>, - <code>const search: SearchDto = await...</code></p>
  
  <p>How <code>class-validator</code> (<code>class-transformer</code>) works when there is no <code>ValidationPipe</code> over it? Is it wrapped it as in server side or it fully ignored? is it calls <code>__decorate</code> and put it inside js bundle?</p>
  
  <p>Otherwise I need to write interfaces like this</p>
  
  <pre><code>export class SearchDto implements ISearchDto {
     @IsOptional()
     readonly offset?: string;
  
     @IsString()
     readonly value: string;
  
     @IsNumber()
     readonly limit: number;
  }
  
  export interface ISearchDto {
    offset?: string;
    value: string;
    limit: number;
  }
  
  let decorated: SearchDto;
  let nonDecorated: ISearchDto;
  </code></pre>
  
  <p>Thank's for help</p>